feat: profile employee with information endpoint
This commit is contained in:
parent
6924017849
commit
c288da6b3a
1 changed files with 111 additions and 159 deletions
|
|
@ -16,28 +16,35 @@ import {
|
||||||
} from "tsoa";
|
} from "tsoa";
|
||||||
import { AppDataSource } from "../database/data-source";
|
import { AppDataSource } from "../database/data-source";
|
||||||
import HttpSuccess from "../interfaces/http-success";
|
import HttpSuccess from "../interfaces/http-success";
|
||||||
import HttpStatusCode from "../interfaces/http-status";
|
import HttpStatus from "../interfaces/http-status";
|
||||||
import HttpError from "../interfaces/http-error";
|
import HttpError from "../interfaces/http-error";
|
||||||
import { Brackets, IsNull, Like, Not } from "typeorm";
|
import { Brackets, IsNull, Like, Not } from "typeorm";
|
||||||
import { OrgRevision } from "../entities/OrgRevision";
|
import { OrgRevision } from "../entities/OrgRevision";
|
||||||
import { calculateRetireDate } from "../interfaces/utils";
|
import { calculateRetireDate } from "../interfaces/utils";
|
||||||
import { EmployeePosMaster } from "../entities/EmployeePosMaster";
|
import { EmployeePosMaster } from "../entities/EmployeePosMaster";
|
||||||
import { ProfileEmployee, CreateProfileEmployee } from "../entities/ProfileEmployee";
|
import {
|
||||||
|
ProfileEmployee,
|
||||||
|
CreateProfileEmployee,
|
||||||
|
UpdateProfileEmployee,
|
||||||
|
ProfileEmployeeHistory,
|
||||||
|
} from "../entities/ProfileEmployee";
|
||||||
import { EmployeePosLevel } from "../entities/EmployeePosLevel";
|
import { EmployeePosLevel } from "../entities/EmployeePosLevel";
|
||||||
import { EmployeePosType } from "../entities/EmployeePosType";
|
import { EmployeePosType } from "../entities/EmployeePosType";
|
||||||
|
import { RequestWithUser } from "../middlewares/user";
|
||||||
|
|
||||||
@Route("api/v1/org/profile-employee")
|
@Route("api/v1/org/profile-employee")
|
||||||
@Tags("Profile")
|
@Tags("Profile")
|
||||||
@Security("bearerAuth")
|
@Security("bearerAuth")
|
||||||
@Response(
|
@Response(
|
||||||
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
HttpStatus.INTERNAL_SERVER_ERROR,
|
||||||
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
||||||
)
|
)
|
||||||
@SuccessResponse(HttpStatusCode.OK, "สำเร็จ")
|
@SuccessResponse(HttpStatus.OK, "สำเร็จ")
|
||||||
export class ProfileEmployeeController extends Controller {
|
export class ProfileEmployeeController extends Controller {
|
||||||
private orgRevisionRepo = AppDataSource.getRepository(OrgRevision);
|
private orgRevisionRepo = AppDataSource.getRepository(OrgRevision);
|
||||||
private posMasterRepo = AppDataSource.getRepository(EmployeePosMaster);
|
private posMasterRepo = AppDataSource.getRepository(EmployeePosMaster);
|
||||||
private profileRepo = AppDataSource.getRepository(ProfileEmployee);
|
private profileRepo = AppDataSource.getRepository(ProfileEmployee);
|
||||||
|
private profileHistoryRepo = AppDataSource.getRepository(ProfileEmployeeHistory);
|
||||||
private posLevelRepo = AppDataSource.getRepository(EmployeePosLevel);
|
private posLevelRepo = AppDataSource.getRepository(EmployeePosLevel);
|
||||||
private posTypeRepo = AppDataSource.getRepository(EmployeePosType);
|
private posTypeRepo = AppDataSource.getRepository(EmployeePosType);
|
||||||
|
|
||||||
|
|
@ -48,58 +55,32 @@ export class ProfileEmployeeController extends Controller {
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Post()
|
@Post()
|
||||||
async createProfile(
|
async createProfile(@Body() body: CreateProfileEmployee, @Request() request: RequestWithUser) {
|
||||||
@Body()
|
if (await this.profileRepo.findOneBy({ citizenId: body.citizenId })) {
|
||||||
requestBody: CreateProfileEmployee,
|
|
||||||
@Request() request: { user: Record<string, any> },
|
|
||||||
) {
|
|
||||||
const _profile = await this.profileRepo.findOne({
|
|
||||||
where: { citizenId: requestBody.citizenId },
|
|
||||||
});
|
|
||||||
if (_profile) {
|
|
||||||
throw new HttpError(
|
throw new HttpError(
|
||||||
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
HttpStatus.INTERNAL_SERVER_ERROR,
|
||||||
"เลขประจำตัวประชาชนนี้มีอยู่ในระบบแล้ว",
|
"เลขประจำตัวประชาชนนี้มีอยู่ในระบบแล้ว",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (requestBody.posLevelId == "") {
|
|
||||||
requestBody.posLevelId = null;
|
if (body.posLevelId === "") body.posLevelId = null;
|
||||||
}
|
if (body.posTypeId === "") body.posTypeId = null;
|
||||||
if (requestBody.posLevelId) {
|
|
||||||
const checkPosLevel = await this.posLevelRepo.findOne({
|
if (body.posLevelId && !(await this.posLevelRepo.findOneBy({ id: body.posLevelId }))) {
|
||||||
where: { id: requestBody.posLevelId },
|
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลระดับตำแหน่งนี้");
|
||||||
});
|
|
||||||
if (!checkPosLevel) {
|
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลระดับตำแหน่งนี้");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (requestBody.posTypeId == "") {
|
if (body.posTypeId && !(await this.posTypeRepo.findOneBy({ id: body.posTypeId }))) {
|
||||||
requestBody.posTypeId = null;
|
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลประเภทตำแหน่งนี้");
|
||||||
}
|
|
||||||
if (requestBody.posTypeId) {
|
|
||||||
const checkPosType = await this.posTypeRepo.findOne({
|
|
||||||
where: { id: requestBody.posTypeId },
|
|
||||||
});
|
|
||||||
if (!checkPosType) {
|
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลประเภทตำแหน่งนี้");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const checkCitizenId = await this.profileRepo.findOne({
|
const profile = Object.assign(new ProfileEmployee(), body);
|
||||||
where: { citizenId: requestBody.citizenId },
|
|
||||||
});
|
|
||||||
|
|
||||||
if (checkCitizenId) {
|
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "เลขประจำตัวประชาชนนี้มีอยู่ในระบบแล้ว");
|
|
||||||
}
|
|
||||||
|
|
||||||
const profile = Object.assign(new ProfileEmployee(), requestBody);
|
|
||||||
profile.createdUserId = request.user.sub;
|
profile.createdUserId = request.user.sub;
|
||||||
profile.createdFullName = request.user.name;
|
profile.createdFullName = request.user.name;
|
||||||
profile.lastUpdateUserId = request.user.sub;
|
profile.lastUpdateUserId = request.user.sub;
|
||||||
profile.lastUpdateFullName = request.user.name;
|
profile.lastUpdateFullName = request.user.name;
|
||||||
await this.profileRepo.save(profile);
|
await this.profileRepo.save(profile);
|
||||||
|
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -112,65 +93,49 @@ export class ProfileEmployeeController extends Controller {
|
||||||
*/
|
*/
|
||||||
@Put("{id}")
|
@Put("{id}")
|
||||||
async updateProfile(
|
async updateProfile(
|
||||||
|
@Request() request: RequestWithUser,
|
||||||
@Path() id: string,
|
@Path() id: string,
|
||||||
@Body()
|
@Body() body: UpdateProfileEmployee,
|
||||||
requestBody: CreateProfileEmployee,
|
|
||||||
@Request() request: { user: Record<string, any> },
|
|
||||||
) {
|
) {
|
||||||
const profile = await this.profileRepo.findOne({ where: { id: id } });
|
const exists =
|
||||||
if (!profile) {
|
!!body.citizenId &&
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลโปรไฟล์นี้");
|
(await this.profileRepo.findOne({
|
||||||
|
where: { id: Not(id), citizenId: body.citizenId },
|
||||||
|
}));
|
||||||
|
|
||||||
|
if (exists) {
|
||||||
|
throw new HttpError(HttpStatus.CONFLICT, "เลขประจำตัวประชาชนนี้มีอยู่ในระบบแล้ว");
|
||||||
}
|
}
|
||||||
|
|
||||||
const _profile = await this.profileRepo.findOne({
|
if (body.posLevelId === "") body.posLevelId = null;
|
||||||
where: { id: Not(id), citizenId: requestBody.citizenId },
|
if (body.posTypeId === "") body.posTypeId = null;
|
||||||
});
|
|
||||||
if (_profile) {
|
if (body.posLevelId && !(await this.posLevelRepo.findOneBy({ id: body.posLevelId }))) {
|
||||||
throw new HttpError(
|
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลระดับตำแหน่งนี้");
|
||||||
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
|
||||||
"เลขประจำตัวประชาชนนี้มีอยู่ในระบบแล้ว",
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (requestBody.posLevelId == "") {
|
if (body.posTypeId && !(await this.posTypeRepo.findOneBy({ id: body.posTypeId }))) {
|
||||||
requestBody.posLevelId = null;
|
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลประเภทตำแหน่งนี้");
|
||||||
}
|
|
||||||
if (requestBody.posLevelId) {
|
|
||||||
const checkPosLevel = await this.posLevelRepo.findOne({
|
|
||||||
where: { id: requestBody.posLevelId },
|
|
||||||
});
|
|
||||||
if (!checkPosLevel) {
|
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลระดับตำแหน่งนี้");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (requestBody.posTypeId == "") {
|
const record = await this.profileRepo.findOneBy({ id });
|
||||||
requestBody.posTypeId = null;
|
|
||||||
}
|
|
||||||
if (requestBody.posTypeId) {
|
|
||||||
const checkPosType = await this.posTypeRepo.findOne({
|
|
||||||
where: { id: requestBody.posTypeId },
|
|
||||||
});
|
|
||||||
if (!checkPosType) {
|
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลประเภทตำแหน่งนี้");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const checkCitizenId = await this.profileRepo.findOne({
|
if (!record) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลโปรไฟล์นี้");
|
||||||
where: {
|
|
||||||
id: Not(id),
|
|
||||||
citizenId: requestBody.citizenId,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
if (checkCitizenId) {
|
await this.profileHistoryRepo.save(
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "เลขประจำตัวประชาชนนี้มีอยู่ในระบบแล้ว");
|
Object.assign(new ProfileEmployeeHistory(), {
|
||||||
}
|
...record,
|
||||||
|
profileEmployeeId: id,
|
||||||
|
id: undefined,
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
|
||||||
|
Object.assign(record, body);
|
||||||
|
record.lastUpdateUserId = request.user.sub;
|
||||||
|
record.lastUpdateFullName = request.user.name;
|
||||||
|
|
||||||
|
await this.profileRepo.save(record);
|
||||||
|
|
||||||
profile.lastUpdateUserId = request.user.sub;
|
|
||||||
profile.lastUpdateFullName = request.user.name;
|
|
||||||
this.profileRepo.merge(profile, requestBody);
|
|
||||||
await this.profileRepo.save(profile);
|
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -183,13 +148,12 @@ export class ProfileEmployeeController extends Controller {
|
||||||
*/
|
*/
|
||||||
@Delete("{id}")
|
@Delete("{id}")
|
||||||
async deleteProfile(@Path() id: string) {
|
async deleteProfile(@Path() id: string) {
|
||||||
const delProfile = await this.profileRepo.findOne({
|
const result = await this.profileRepo.delete({ id });
|
||||||
where: { id },
|
|
||||||
});
|
if (result.affected && result.affected <= 0) {
|
||||||
if (!delProfile) {
|
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลโปรไฟล์นี้");
|
|
||||||
}
|
}
|
||||||
await this.profileRepo.delete({ id: id });
|
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -203,21 +167,18 @@ export class ProfileEmployeeController extends Controller {
|
||||||
@Get("{id}")
|
@Get("{id}")
|
||||||
async detailProfile(@Path() id: string) {
|
async detailProfile(@Path() id: string) {
|
||||||
const profile = await this.profileRepo.findOne({
|
const profile = await this.profileRepo.findOne({
|
||||||
|
relations: {
|
||||||
|
posLevel: true,
|
||||||
|
posType: true,
|
||||||
|
gender: true,
|
||||||
|
relationship: true,
|
||||||
|
bloodGroup: true,
|
||||||
|
},
|
||||||
where: { id },
|
where: { id },
|
||||||
select: [
|
|
||||||
"id",
|
|
||||||
"prefix",
|
|
||||||
"firstName",
|
|
||||||
"lastName",
|
|
||||||
"citizenId",
|
|
||||||
"position",
|
|
||||||
"posLevelId",
|
|
||||||
"posTypeId",
|
|
||||||
],
|
|
||||||
});
|
});
|
||||||
if (!profile) {
|
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
if (!profile) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
||||||
}
|
|
||||||
return new HttpSuccess(profile);
|
return new HttpSuccess(profile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -231,57 +192,48 @@ export class ProfileEmployeeController extends Controller {
|
||||||
async listProfile(
|
async listProfile(
|
||||||
@Query("page") page: number = 1,
|
@Query("page") page: number = 1,
|
||||||
@Query("pageSize") pageSize: number = 10,
|
@Query("pageSize") pageSize: number = 10,
|
||||||
@Query("keyword") keyword?: string,
|
@Query("keyword") keyword: string = "",
|
||||||
) {
|
) {
|
||||||
const [profile, total] = await this.profileRepo.findAndCount({
|
const [record, total] = await this.profileRepo.findAndCount({
|
||||||
select: [
|
relations: {
|
||||||
"id",
|
posLevel: true,
|
||||||
"prefix",
|
posType: true,
|
||||||
"firstName",
|
gender: true,
|
||||||
"lastName",
|
relationship: true,
|
||||||
"citizenId",
|
bloodGroup: true,
|
||||||
"position",
|
},
|
||||||
"posLevelId",
|
where: [
|
||||||
"posTypeId",
|
{ citizenId: Like(`%${keyword}%`) },
|
||||||
|
{ position: Like(`%${keyword}%`) },
|
||||||
|
{ prefix: Like(`%${keyword}%`) },
|
||||||
|
{ firstName: Like(`%${keyword}%`) },
|
||||||
|
{ lastName: Like(`%${keyword}%`) },
|
||||||
|
{ email: Like(`%${keyword}%`) },
|
||||||
|
{ telephoneNumber: Like(`%${keyword}%`) },
|
||||||
],
|
],
|
||||||
order: { createdAt: "ASC" },
|
order: { createdAt: "ASC" },
|
||||||
skip: (page - 1) * pageSize,
|
skip: (page - 1) * pageSize,
|
||||||
take: pageSize,
|
take: pageSize,
|
||||||
});
|
});
|
||||||
if (keyword != undefined && keyword !== "") {
|
return new HttpSuccess({ data: record, total });
|
||||||
const formattedKeyword = keyword.toLowerCase().replace(/\s+/g, "");
|
}
|
||||||
const filteredProfile = profile.filter(
|
|
||||||
(x) =>
|
|
||||||
(x.prefix + x.firstName + x.lastName).replace(/\s+/g, "").includes(formattedKeyword) ||
|
|
||||||
x.citizenId?.toString().includes(keyword) ||
|
|
||||||
x.position?.toString().includes(keyword),
|
|
||||||
);
|
|
||||||
|
|
||||||
const formattedData = filteredProfile.map((item) => ({
|
@Get("history/{id}")
|
||||||
id: item.id,
|
async getProfileHistory(@Path() id: string) {
|
||||||
prefix: item.prefix,
|
const profile = await this.profileHistoryRepo.find({
|
||||||
firstName: item.firstName,
|
relations: {
|
||||||
lastName: item.lastName,
|
posLevel: true,
|
||||||
citizenId: item.citizenId,
|
posType: true,
|
||||||
position: item.position,
|
gender: true,
|
||||||
posLevelId: item.posLevelId,
|
relationship: true,
|
||||||
posTypeId: item.posTypeId,
|
bloodGroup: true,
|
||||||
}));
|
},
|
||||||
|
where: { profileEmployeeId: id },
|
||||||
|
});
|
||||||
|
|
||||||
return new HttpSuccess({ data: formattedData, total: formattedData.length });
|
if (!profile) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
||||||
}
|
|
||||||
|
|
||||||
const formattedData = profile.map((item) => ({
|
return new HttpSuccess(profile);
|
||||||
id: item.id,
|
|
||||||
prefix: item.prefix,
|
|
||||||
firstName: item.firstName,
|
|
||||||
lastName: item.lastName,
|
|
||||||
citizenId: item.citizenId,
|
|
||||||
position: item.position,
|
|
||||||
posLevelId: item.posLevelId,
|
|
||||||
posTypeId: item.posTypeId,
|
|
||||||
}));
|
|
||||||
return new HttpSuccess({ data: formattedData, total });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -310,7 +262,7 @@ export class ProfileEmployeeController extends Controller {
|
||||||
relations: ["posMasters"],
|
relations: ["posMasters"],
|
||||||
});
|
});
|
||||||
if (!orgRevision) {
|
if (!orgRevision) {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบแบบร่างโครงสร้าง");
|
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบแบบร่างโครงสร้าง");
|
||||||
}
|
}
|
||||||
const [profiles, total] = await this.profileRepo
|
const [profiles, total] = await this.profileRepo
|
||||||
.createQueryBuilder("profileEmployee")
|
.createQueryBuilder("profileEmployee")
|
||||||
|
|
@ -417,7 +369,7 @@ export class ProfileEmployeeController extends Controller {
|
||||||
relations: ["posLevel", "posType", "current_holders", "current_holders.orgRoot"],
|
relations: ["posLevel", "posType", "current_holders", "current_holders.orgRoot"],
|
||||||
});
|
});
|
||||||
if (!profile) {
|
if (!profile) {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลบุคคลนี้ในระบบ");
|
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลบุคคลนี้ในระบบ");
|
||||||
}
|
}
|
||||||
|
|
||||||
const orgRevisionPublish = await this.orgRevisionRepo
|
const orgRevisionPublish = await this.orgRevisionRepo
|
||||||
|
|
@ -426,7 +378,7 @@ export class ProfileEmployeeController extends Controller {
|
||||||
.andWhere("orgRevision.orgRevisionIsCurrent = true")
|
.andWhere("orgRevision.orgRevisionIsCurrent = true")
|
||||||
.getOne();
|
.getOne();
|
||||||
if (!orgRevisionPublish) {
|
if (!orgRevisionPublish) {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบแบบร่างโครงสร้าง");
|
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบแบบร่างโครงสร้าง");
|
||||||
}
|
}
|
||||||
|
|
||||||
const _profile = {
|
const _profile = {
|
||||||
|
|
@ -780,7 +732,7 @@ export class ProfileEmployeeController extends Controller {
|
||||||
});
|
});
|
||||||
if (profile) {
|
if (profile) {
|
||||||
throw new HttpError(
|
throw new HttpError(
|
||||||
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
HttpStatus.INTERNAL_SERVER_ERROR,
|
||||||
"เลขประจำตัวประชาชนนี้มีอยู่ในระบบแล้ว",
|
"เลขประจำตัวประชาชนนี้มีอยู่ในระบบแล้ว",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -916,7 +868,7 @@ export class ProfileEmployeeController extends Controller {
|
||||||
where: { orgRevisionIsCurrent: true },
|
where: { orgRevisionIsCurrent: true },
|
||||||
});
|
});
|
||||||
if (!findRevision) {
|
if (!findRevision) {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "not found. OrgRevision");
|
throw new HttpError(HttpStatus.NOT_FOUND, "not found. OrgRevision");
|
||||||
}
|
}
|
||||||
|
|
||||||
const [findPosMaster, total] = await AppDataSource.getRepository(EmployeePosMaster)
|
const [findPosMaster, total] = await AppDataSource.getRepository(EmployeePosMaster)
|
||||||
|
|
@ -1007,7 +959,7 @@ export class ProfileEmployeeController extends Controller {
|
||||||
.take(body.pageSize)
|
.take(body.pageSize)
|
||||||
.getManyAndCount();
|
.getManyAndCount();
|
||||||
if (!findPosMaster) {
|
if (!findPosMaster) {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "not found. PosMaster");
|
throw new HttpError(HttpStatus.NOT_FOUND, "not found. PosMaster");
|
||||||
}
|
}
|
||||||
|
|
||||||
const formattedData = findPosMaster.map((item) => {
|
const formattedData = findPosMaster.map((item) => {
|
||||||
|
|
@ -1119,7 +1071,7 @@ export class ProfileEmployeeController extends Controller {
|
||||||
relations: ["posLevel", "posType", "current_holders", "current_holders.orgRoot"],
|
relations: ["posLevel", "posType", "current_holders", "current_holders.orgRoot"],
|
||||||
});
|
});
|
||||||
if (!profile) {
|
if (!profile) {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลบุคคลนี้ในระบบ");
|
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลบุคคลนี้ในระบบ");
|
||||||
}
|
}
|
||||||
|
|
||||||
const _profile = {
|
const _profile = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue