This commit is contained in:
parent
04484444ec
commit
a1be5c9946
2 changed files with 16 additions and 5 deletions
|
|
@ -19,6 +19,7 @@ import { AppDataSource } from "../database/data-source";
|
|||
import HttpSuccess from "../interfaces/http-success";
|
||||
import HttpStatus from "../interfaces/http-status";
|
||||
import HttpError from "../interfaces/http-error";
|
||||
import HttpStatusCode from "../interfaces/http-status";
|
||||
import { Brackets, Double, In, IsNull, Like, Not } from "typeorm";
|
||||
import { OrgRevision } from "../entities/OrgRevision";
|
||||
import {
|
||||
|
|
@ -2039,9 +2040,13 @@ export class ProfileEmployeeController extends Controller {
|
|||
if (!result) {
|
||||
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
}
|
||||
await new permission().PermissionOrgUserDelete(request, "SYS_REGISTRY_EMP", result.id);
|
||||
await this.informationHistoryRepository.delete({ profileEmployeeId: id });
|
||||
await this.profileRepo.remove(result);
|
||||
try{
|
||||
await new permission().PermissionOrgUserDelete(request, "SYS_REGISTRY_EMP", result.id);
|
||||
await this.informationHistoryRepository.delete({ profileEmployeeId: id });
|
||||
await this.profileRepo.remove(result);
|
||||
} catch {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่สามารถลบข้อมูลได้");
|
||||
}
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -69,6 +69,7 @@ import axios from "axios";
|
|||
import { deleteUser } from "../keycloak";
|
||||
import { ProfileSalaryHistory } from "../entities/ProfileSalaryHistory";
|
||||
import { getTopDegrees } from "../services/PositionService";
|
||||
import HttpStatusCode from "../interfaces/http-status";
|
||||
@Route("api/v1/org/profile-temp")
|
||||
@Tags("ProfileEmployee")
|
||||
@Security("bearerAuth")
|
||||
|
|
@ -1027,8 +1028,13 @@ export class ProfileEmployeeTempController extends Controller {
|
|||
if (!result) {
|
||||
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
}
|
||||
await this.informationHistoryRepository.delete({ profileEmployeeId: id });
|
||||
await this.profileRepo.remove(result);
|
||||
|
||||
try{
|
||||
await this.informationHistoryRepository.delete({ profileEmployeeId: id });
|
||||
await this.profileRepo.remove(result);
|
||||
} catch {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่สามารถลบข้อมูลได้");
|
||||
}
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue