แก้ชื่อ tag

This commit is contained in:
Kittapath 2024-01-26 17:09:28 +07:00
parent 4b4f2423fa
commit f509e10f8c
9 changed files with 151 additions and 107 deletions

View file

@ -159,6 +159,14 @@ export class OrgChild1Controller {
throw new HttpError(HttpStatusCode.NOT_FOUND, "not found. RootId");
}
const validOrgChild1Ranks = ["OFFICE", "DIVISION", "SECTION"];
if (
requestBody.orgChild1Rank == null ||
!validOrgChild1Ranks.includes(requestBody.orgChild1Rank.toUpperCase())
) {
throw new HttpError(HttpStatusCode.NOT_FOUND, "not found. orgChild2Rank");
}
const child1 = await this.child1Repository.findOne({ where: { id } });
if (!child1) {
throw new HttpError(HttpStatusCode.NOT_FOUND, "not found.");