แก้สิทธิ์ สกจ
This commit is contained in:
parent
ceaebeaafc
commit
376ab804db
1 changed files with 28 additions and 16 deletions
|
|
@ -105,14 +105,20 @@ export class OrgChild1Controller {
|
|||
}
|
||||
|
||||
if (requestBody.isOfficer == true) {
|
||||
await Promise.all(
|
||||
rootIdExits.orgChild1s
|
||||
.filter((x: OrgChild1) => x.isOfficer == true)
|
||||
.map(async (item: OrgChild1) => {
|
||||
item.isOfficer = false;
|
||||
await this.child1Repository.save(item);
|
||||
}),
|
||||
);
|
||||
const orgRevision = await this.orgRevisionRepository.findOne({
|
||||
where: { id: rootIdExits.orgRevisionId },
|
||||
relations: ["orgChild1s"],
|
||||
});
|
||||
if (orgRevision != null) {
|
||||
await Promise.all(
|
||||
orgRevision.orgChild1s
|
||||
.filter((x: OrgChild1) => x.isOfficer == true)
|
||||
.map(async (item: OrgChild1) => {
|
||||
item.isOfficer = false;
|
||||
await this.child1Repository.save(item);
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const revisionIdExits = await this.orgRevisionRepository.findOne({
|
||||
|
|
@ -214,14 +220,20 @@ export class OrgChild1Controller {
|
|||
}
|
||||
|
||||
if (requestBody.isOfficer == true) {
|
||||
await Promise.all(
|
||||
rootIdExits.orgChild1s
|
||||
.filter((x: OrgChild1) => x.isOfficer == true)
|
||||
.map(async (item: OrgChild1) => {
|
||||
item.isOfficer = false;
|
||||
await this.child1Repository.save(item);
|
||||
}),
|
||||
);
|
||||
const orgRevision = await this.orgRevisionRepository.findOne({
|
||||
where: { id: rootIdExits.orgRevisionId },
|
||||
relations: ["orgChild1s"],
|
||||
});
|
||||
if (orgRevision != null) {
|
||||
await Promise.all(
|
||||
orgRevision.orgChild1s
|
||||
.filter((x: OrgChild1) => x.isOfficer == true)
|
||||
.map(async (item: OrgChild1) => {
|
||||
item.isOfficer = false;
|
||||
await this.child1Repository.save(item);
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const revisionIdExits = await this.orgRevisionRepository.findOne({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue