fix update
This commit is contained in:
parent
b222cbae3f
commit
cb5ebf0047
1 changed files with 5 additions and 11 deletions
|
|
@ -961,7 +961,6 @@ export class PositionController extends Controller {
|
|||
if (!posMaster) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
}
|
||||
|
||||
let orgRoot: any = null;
|
||||
let SName: any = null;
|
||||
let revisionId:any = null;
|
||||
|
|
@ -969,35 +968,35 @@ export class PositionController extends Controller {
|
|||
orgRoot = await this.orgRootRepository.findOne({
|
||||
where: { id: requestBody.orgRootId },
|
||||
});
|
||||
revisionId = orgRoot.orgRevisionId;
|
||||
revisionId = orgRoot?.orgRevisionId;
|
||||
if (!orgRoot) {
|
||||
let orgChild1: any = null;
|
||||
if (requestBody.orgChild1Id != null)
|
||||
orgChild1 = await this.child1Repository.findOne({
|
||||
where: { id: requestBody.orgChild1Id },
|
||||
});
|
||||
revisionId = orgChild1.orgRevisionId;
|
||||
revisionId = orgChild1?.orgRevisionId;
|
||||
if (!orgChild1) {
|
||||
let orgChild2: any = null;
|
||||
if (requestBody.orgChild2Id != null)
|
||||
orgChild2 = await this.child2Repository.findOne({
|
||||
where: { id: requestBody.orgChild2Id },
|
||||
});
|
||||
revisionId = orgChild2.orgRevisionId;
|
||||
revisionId = orgChild2?.orgRevisionId;
|
||||
if (!orgChild2) {
|
||||
let orgChild3: any = null;
|
||||
if (requestBody.orgChild3Id != null)
|
||||
orgChild3 = await this.child3Repository.findOne({
|
||||
where: { id: requestBody.orgChild3Id },
|
||||
});
|
||||
revisionId = orgChild3.orgRevisionId;
|
||||
revisionId = orgChild3?.orgRevisionId;
|
||||
if (!orgChild3) {
|
||||
let orgChild4: any = null;
|
||||
if (requestBody.orgChild4Id != null)
|
||||
orgChild4 = await this.child4Repository.findOne({
|
||||
where: { id: requestBody.orgChild4Id },
|
||||
});
|
||||
revisionId = orgChild4.orgRevisionId;
|
||||
revisionId = orgChild4?.orgRevisionId;
|
||||
if (!orgChild4) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลโครงสร้าง");
|
||||
} else {
|
||||
|
|
@ -1095,7 +1094,6 @@ export class PositionController extends Controller {
|
|||
posMaster.orgRevisionId = orgRoot.orgRevisionId;
|
||||
SName = orgRoot.orgRootShortName;
|
||||
}
|
||||
|
||||
const chk_SName0 = await this.posMasterRepository.findOne({
|
||||
where: {
|
||||
orgRevisionId: posMaster.orgRevisionId,
|
||||
|
|
@ -1111,7 +1109,6 @@ export class PositionController extends Controller {
|
|||
"ไม่สามารถใส่เลขที่ตำแหน่งซ้ำกันได้",
|
||||
);
|
||||
}
|
||||
|
||||
const chk_SName1 = await this.posMasterRepository.findOne({
|
||||
where: {
|
||||
orgRevisionId: posMaster.orgRevisionId,
|
||||
|
|
@ -1127,7 +1124,6 @@ export class PositionController extends Controller {
|
|||
"ไม่สามารถใส่เลขที่ตำแหน่งซ้ำกันได้",
|
||||
);
|
||||
}
|
||||
|
||||
const chk_SName2 = await this.posMasterRepository.findOne({
|
||||
where: {
|
||||
orgRevisionId: posMaster.orgRevisionId,
|
||||
|
|
@ -1143,7 +1139,6 @@ export class PositionController extends Controller {
|
|||
"ไม่สามารถใส่เลขที่ตำแหน่งซ้ำกันได้",
|
||||
);
|
||||
}
|
||||
|
||||
const chk_SName3 = await this.posMasterRepository.findOne({
|
||||
where: {
|
||||
orgRevisionId: posMaster.orgRevisionId,
|
||||
|
|
@ -1159,7 +1154,6 @@ export class PositionController extends Controller {
|
|||
"ไม่สามารถใส่เลขที่ตำแหน่งซ้ำกันได้",
|
||||
);
|
||||
}
|
||||
|
||||
const chk_SName4 = await this.posMasterRepository.findOne({
|
||||
where: {
|
||||
orgRevisionId: posMaster.orgRevisionId,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue