แก้api ลูกจ้างประจำ

This commit is contained in:
JoolsoftAdmin 2024-08-13 11:03:42 +07:00
parent ab138c2e04
commit 23e5d4f7fe
44 changed files with 7960 additions and 79 deletions

View file

@ -165,8 +165,11 @@ export class ProfileInsigniaEmployeeController extends Controller {
}
@Post()
public async newInsignia(@Request() req: RequestWithUser, @Body() body: CreateProfileEmployeeInsignia) {
await new permission().PermissionCreate(req,"SYS_REGISTRY_EMP");
public async newInsignia(
@Request() req: RequestWithUser,
@Body() body: CreateProfileEmployeeInsignia,
) {
await new permission().PermissionCreate(req, "SYS_REGISTRY_EMP");
if (!body.profileEmployeeId) {
throw new HttpError(HttpStatus.BAD_REQUEST, "กรุณากรอก profileEmployeeId");
}
@ -206,7 +209,7 @@ export class ProfileInsigniaEmployeeController extends Controller {
@Body() body: UpdateProfileInsignia,
@Path() insigniaId: string,
) {
await new permission().PermissionUpdate(req,"SYS_REGISTRY_EMP");
await new permission().PermissionUpdate(req, "SYS_REGISTRY_EMP");
const record = await this.insigniaRepo.findOneBy({ id: insigniaId });
if (!record) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
@ -233,7 +236,7 @@ export class ProfileInsigniaEmployeeController extends Controller {
@Delete("{insigniaId}")
public async deleteInsignia(@Path() insigniaId: string, @Request() req: RequestWithUser) {
await new permission().PermissionDelete(req,"SYS_REGISTRY_EMP");
await new permission().PermissionDelete(req, "SYS_REGISTRY_EMP");
await this.insigniaHistoryRepo.delete({
profileInsigniaId: insigniaId,
});