แก้ฟิลด์ orgCode
This commit is contained in:
parent
5a7e5cfa0e
commit
e82b4f6a85
5 changed files with 31 additions and 9 deletions
|
|
@ -50,7 +50,11 @@ export class OrgChild1Controller {
|
|||
try {
|
||||
const orgChild1 = await this.child1Repository.findOne({ where: { id } });
|
||||
if (!orgChild1) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล โครงสร้างระดับ 1");
|
||||
}
|
||||
const orgRoot = await this.orgRootRepository.findOne({ where: { id: orgChild1.orgRootId } });
|
||||
if (!orgRoot) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล โครงสร้างระดับ Root");
|
||||
}
|
||||
const getOrgChild1 = {
|
||||
"orgChild1Id" : orgChild1.id,
|
||||
|
|
@ -62,7 +66,7 @@ export class OrgChild1Controller {
|
|||
"orgChild1PhoneIn" : orgChild1.orgChild1PhoneIn,
|
||||
"orgChild1Fax" : orgChild1.orgChild1Fax,
|
||||
"orgRevisionId" : orgChild1.orgRevisionId,
|
||||
"orgCode" : orgChild1.orgChild1Code+"00"
|
||||
"orgCode" : orgRoot.orgRootCode + orgChild1.orgChild1Code
|
||||
}
|
||||
return new HttpSuccess(getOrgChild1);
|
||||
} catch (error) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue