This commit is contained in:
AdisakKanthawilang 2024-08-27 14:19:04 +07:00
parent eb1e797354
commit 79b652d628
9 changed files with 32 additions and 32 deletions

View file

@ -580,7 +580,8 @@ export class ProfileEmployeeController extends Controller {
*
*/
@Post()
async createProfile(@Body() body: CreateProfileEmployee, @Request() request: RequestWithUser) { //ไม่แน่ใจEMP
async createProfile(@Body() body: CreateProfileEmployee, @Request() request: RequestWithUser) {
//ไม่แน่ใจEMPปิดไว้ก่อน
if (await this.profileRepo.findOneBy({ citizenId: body.citizenId })) {
throw new HttpError(
HttpStatus.INTERNAL_SERVER_ERROR,
@ -1058,7 +1059,7 @@ export class ProfileEmployeeController extends Controller {
*/
@Get("{id}")
async detailProfile(@Path() id: string, @Request() req: RequestWithUser) {
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", id); //ไม่แน่ใจEMP
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", id);
const profile = await this.profileRepo.findOne({
relations: {
posLevel: true,
@ -2659,7 +2660,7 @@ export class ProfileEmployeeController extends Controller {
*/
@Get("profileid/retire/{year}")
async getProfileByRetireYear(@Path() year: number, @Request() req: RequestWithUser) {
// await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_EMP", id);//ไม่แน่ใจEMP
// await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_EMP", id);//ไม่แน่ใจEMPปิดไว้ก่อน
const profiles = await this.profileRepo
.createQueryBuilder("profileEmployee")
.leftJoinAndSelect("profileEmployee.posLevel", "posLevel")
@ -2862,7 +2863,7 @@ export class ProfileEmployeeController extends Controller {
where: { id: id },
});
if (!profile) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
await new permission().PermissionOrgUserUpdate(request, "SYS_REGISTRY_EMP", profile.id);
await new permission().PermissionOrgUserUpdate(request, "SYS_REGISTRY_EMP", profile.id);//ไม่แน่ใจEMPปิดไว้ก่อน
profile.isLeave = requestBody.isLeave;
profile.leaveReason = requestBody.leaveReason;