แก้ชื่อ 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

@ -51,7 +51,7 @@ export class OrgChild4Controller extends Controller {
orgChild4PhoneEx: "string", //หมายเลขโทรศัพท์ที่ติดต่อจากภายนอก
orgChild4PhoneIn: "string", //หมายเลขโทรศัพท์ที่ติดต่อจากภายใน
orgChild4Fax: "string", //หมายเลขโทรสาร
orgChild4IsNormal: "boolean", //สถานะของหน่วยงาน
// orgChild4IsNormal: "boolean", //สถานะของหน่วยงาน
orgChild3Id: "Guid", //id Child1
},
])
@ -109,7 +109,7 @@ export class OrgChild4Controller extends Controller {
orgChild4PhoneEx: "string", //หมายเลขโทรศัพท์ที่ติดต่อจากภายนอก
orgChild4PhoneIn: "string", //หมายเลขโทรศัพท์ที่ติดต่อจากภายใน
orgChild4Fax: "string", //หมายเลขโทรสาร
orgChild4IsNormal: "boolean", //สถานะของหน่วยงาน
// orgChild4IsNormal: "boolean", //สถานะของหน่วยงาน
orgChild3Id: "Guid", //id Child1
},
])
@ -127,6 +127,14 @@ export class OrgChild4Controller extends Controller {
throw new HttpError(HttpStatusCode.NOT_FOUND, "not found. Child3Id");
}
const validOrgChild4Ranks = ["OFFICE", "DIVISION", "SECTION"];
if (
requestBody.orgChild4Rank == null ||
!validOrgChild4Ranks.includes(requestBody.orgChild4Rank.toUpperCase())
) {
throw new HttpError(HttpStatusCode.NOT_FOUND, "not found. orgChild2Rank");
}
const child4 = await this.child4Repository.findOne({ where: { id } });
if (!child4) {
throw new HttpError(HttpStatusCode.NOT_FOUND, "not found.");