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