เพิ่มฟิวผู้บังคับ
This commit is contained in:
parent
ba00645cb8
commit
ecbb9c0d9f
7 changed files with 171 additions and 64 deletions
|
|
@ -63,17 +63,21 @@ export class KpiUserSpecialController extends Controller {
|
|||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
}
|
||||
|
||||
|
||||
const chk_indicator = await this.kpiUserSpecialRepository.findOne({
|
||||
where: {
|
||||
kpiUserEvaluationId: requestBody.kpiUserEvaluationId,
|
||||
},
|
||||
})
|
||||
if (chk_indicator && chk_indicator.including == requestBody.including || chk_indicator && chk_indicator.includingName == requestBody.includingName) {
|
||||
throw new HttpError(HttpStatusCode.CONFLICT, "ไม่สามารถเพิ่มข้อมูลได้เนื่องจากข้อมูลตัวชี้วัดซ้ำ");
|
||||
});
|
||||
if (
|
||||
(chk_indicator && chk_indicator.including == requestBody.including) ||
|
||||
(chk_indicator && chk_indicator.includingName == requestBody.includingName)
|
||||
) {
|
||||
throw new HttpError(
|
||||
HttpStatusCode.CONFLICT,
|
||||
"ไม่สามารถเพิ่มข้อมูลได้เนื่องจากข้อมูลตัวชี้วัดซ้ำ",
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
kpiUserSpecial.createdUserId = request.user.sub;
|
||||
kpiUserSpecial.createdFullName = request.user.name;
|
||||
kpiUserSpecial.lastUpdateUserId = request.user.sub;
|
||||
|
|
@ -111,9 +115,15 @@ export class KpiUserSpecialController extends Controller {
|
|||
id: Not(id),
|
||||
kpiUserEvaluationId: requestBody.kpiUserEvaluationId,
|
||||
},
|
||||
})
|
||||
if (chk_indicator && chk_indicator.including == requestBody.including || chk_indicator && chk_indicator.includingName == requestBody.includingName) {
|
||||
throw new HttpError(HttpStatusCode.CONFLICT, "ไม่สามารถเพิ่มข้อมูลได้เนื่องจากข้อมูลตัวชี้วัดซ้ำ");
|
||||
});
|
||||
if (
|
||||
(chk_indicator && chk_indicator.including == requestBody.including) ||
|
||||
(chk_indicator && chk_indicator.includingName == requestBody.includingName)
|
||||
) {
|
||||
throw new HttpError(
|
||||
HttpStatusCode.CONFLICT,
|
||||
"ไม่สามารถเพิ่มข้อมูลได้เนื่องจากข้อมูลตัวชี้วัดซ้ำ",
|
||||
);
|
||||
}
|
||||
|
||||
kpiUserSpecial.lastUpdateUserId = request.user.sub;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue