ข้อมูลการประเมิน>>สมรรถนะ (บันทึกข้อมูลตำแหน่ง แต่ข้อมูลตำแหน่งไม่แสดง) #593
This commit is contained in:
parent
32de413e1c
commit
a83e1f111b
1 changed files with 13 additions and 13 deletions
|
|
@ -136,10 +136,23 @@ export class kpiLinkController extends Controller {
|
|||
...requestBody,
|
||||
kpiCapacitys: [],
|
||||
});
|
||||
|
||||
const chkCapacity = await this.kpiCapacityRepository.find({
|
||||
where: {
|
||||
id: In(requestBody.kpiCapacityIds),
|
||||
},
|
||||
});
|
||||
if (!chkCapacity) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลการเชื่อมโยง");
|
||||
}
|
||||
|
||||
chkKpiLink.kpiCapacitys = chkCapacity;
|
||||
chkKpiLink.kpiGroupId = requestBody.kpiGroupId;
|
||||
chkKpiLink.lastUpdateUserId = request.user.sub;
|
||||
chkKpiLink.lastUpdateFullName = request.user.name;
|
||||
chkKpiLink.lastUpdatedAt = new Date();
|
||||
await this.kpiLinkRepository.save(chkKpiLink);
|
||||
setLogDataDiff(request, { before, after: chkKpiLink });
|
||||
|
||||
if (requestBody.positions != null) {
|
||||
await Promise.all(
|
||||
|
|
@ -159,19 +172,6 @@ export class kpiLinkController extends Controller {
|
|||
);
|
||||
}
|
||||
|
||||
const chkCapacity = await this.kpiCapacityRepository.find({
|
||||
where: {
|
||||
id: In(requestBody.kpiCapacityIds),
|
||||
},
|
||||
});
|
||||
if (!chkCapacity) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลการเชื่อมโยง");
|
||||
}
|
||||
chkKpiLink.kpiCapacitys = chkCapacity;
|
||||
|
||||
await this.kpiLinkRepository.save(chkKpiLink, { data: request });
|
||||
setLogDataDiff(request, { before, after: chkKpiLink });
|
||||
|
||||
return new HttpSuccess(chkKpiLink.id);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue