This commit is contained in:
AdisakKanthawilang 2024-01-30 16:39:22 +07:00
parent f5c5d21a3e
commit e601dfccab
3 changed files with 34 additions and 2 deletions

View file

@ -97,7 +97,7 @@ export class OrgRootController extends Controller {
}
const chkCode = await this.orgRootRepository.findOne({
where: { orgRootCode: requestBody.orgRootCode },
where: { orgRevisionId: requestBody.orgRevisionId , orgRootCode: requestBody.orgRootCode },
});
if (chkCode != null) {
throw new HttpError(HttpStatusCode.NOT_FOUND, "รหัสหน่วยงานนี้มีอยู่ในระบบแล้ว");
@ -176,7 +176,7 @@ export class OrgRootController extends Controller {
}
const chkCode = await this.orgRootRepository.findOne({
where: { orgRootCode: requestBody.orgRootCode },
where: { orgRevisionId: requestBody.orgRevisionId , orgRootCode: requestBody.orgRootCode },
});
if (chkCode?.id != id && chkCode != null) {
throw new HttpError(HttpStatusCode.NOT_FOUND, "รหัสหน่วยงานนี้มีอยู่ในระบบแล้ว");