แก้ parent

This commit is contained in:
mamoss 2025-12-07 16:36:18 +07:00
parent f814454003
commit a8bb884564
4 changed files with 89 additions and 89 deletions

View file

@ -1028,12 +1028,15 @@ export class ProfileEmployeeTempController extends Controller {
if (!result) {
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
}
try{
try {
await this.informationHistoryRepository.delete({ profileEmployeeId: id });
await this.profileRepo.remove(result);
} catch {
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่สามารถลบข้อมูลได้ เนื่องจากข้อมูลนี้ถูกใช้งานในระบบอื่น");
throw new HttpError(
HttpStatusCode.NOT_FOUND,
"ไม่สามารถลบข้อมูลได้ เนื่องจากข้อมูลนี้ถูกใช้งานในระบบอื่น",
);
}
return new HttpSuccess();
}
@ -1106,7 +1109,7 @@ export class ProfileEmployeeTempController extends Controller {
_dataOrg.child1 != undefined && _dataOrg.child1 != null
? _dataOrg.child1[0] != null
? `current_holderTemps.orgChild1Id IN (:...child1)`
: `current_holderTemps.orgChild1Id is null`
: `current_holderTemps.orgChild1Id is ${_dataOrg.privilege == "PARENT" ? "not null" : "null"}`
: "1=1",
{
child1: _dataOrg.child1,
@ -1561,7 +1564,7 @@ export class ProfileEmployeeTempController extends Controller {
_data.child1 != undefined && _data.child1 != null
? _data.child1[0] != null
? `current_holderTemps.orgChild1Id IN (:...child1)`
: `current_holderTemps.orgChild1Id is null`
: `current_holderTemps.orgChild1Id is ${_data.privilege == "PARENT" ? "not null" : "null"}`
: "1=1",
{
child1: _data.child1,
@ -2270,7 +2273,7 @@ export class ProfileEmployeeTempController extends Controller {
_data.child1 != undefined && _data.child1 != null
? _data.child1[0] != null
? `current_holderTemps.orgChild1Id IN (:...child1)`
: `current_holderTemps.orgChild1Id is null`
: `current_holderTemps.orgChild1Id is ${_data.privilege == "PARENT" ? "not null" : "null"}`
: "1=1",
{ child1: _data.child1 },
)