แก้api ลูกจ้างประจำ
This commit is contained in:
parent
ab138c2e04
commit
23e5d4f7fe
44 changed files with 7960 additions and 79 deletions
|
|
@ -53,7 +53,7 @@ export class ProfileEducationsEmployeeController extends Controller {
|
|||
}
|
||||
return new HttpSuccess(getProfileEducation);
|
||||
}
|
||||
|
||||
|
||||
@Get("{profileEmployeeId}")
|
||||
@Example({
|
||||
status: 200,
|
||||
|
|
@ -93,8 +93,8 @@ export class ProfileEducationsEmployeeController extends Controller {
|
|||
})
|
||||
public async detailProfileEducation(@Path() profileEmployeeId: string) {
|
||||
const getProfileEducation = await this.profileEducationRepo.find({
|
||||
where: { profileEmployeeId: profileEmployeeId}
|
||||
});
|
||||
where: { profileEmployeeId: profileEmployeeId },
|
||||
});
|
||||
if (!getProfileEducation) {
|
||||
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
}
|
||||
|
|
@ -183,7 +183,7 @@ export class ProfileEducationsEmployeeController extends Controller {
|
|||
@Request() req: RequestWithUser,
|
||||
@Body() body: CreateProfileEducationEmployee,
|
||||
) {
|
||||
await new permission().PermissionCreate(req,"SYS_REGISTRY_EMP");
|
||||
await new permission().PermissionCreate(req, "SYS_REGISTRY_EMP");
|
||||
if (!body.profileEmployeeId) {
|
||||
throw new HttpError(HttpStatus.BAD_REQUEST, "กรุณากรอก profileEmployeeId");
|
||||
}
|
||||
|
|
@ -214,7 +214,7 @@ export class ProfileEducationsEmployeeController extends Controller {
|
|||
@Request() req: RequestWithUser,
|
||||
@Path() educationId: string,
|
||||
) {
|
||||
await new permission().PermissionUpdate(req,"SYS_REGISTRY_EMP");
|
||||
await new permission().PermissionUpdate(req, "SYS_REGISTRY_EMP");
|
||||
const record = await this.profileEducationRepo.findOneBy({ id: educationId });
|
||||
if (!record) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
|
||||
|
|
@ -236,8 +236,11 @@ export class ProfileEducationsEmployeeController extends Controller {
|
|||
}
|
||||
|
||||
@Delete("{educationId}")
|
||||
public async deleteProfileEducation(@Path() educationId: string, @Request() req: RequestWithUser) {
|
||||
await new permission().PermissionDelete(req,"SYS_REGISTRY_EMP");
|
||||
public async deleteProfileEducation(
|
||||
@Path() educationId: string,
|
||||
@Request() req: RequestWithUser,
|
||||
) {
|
||||
await new permission().PermissionDelete(req, "SYS_REGISTRY_EMP");
|
||||
await this.profileEducationHistoryRepo.delete({
|
||||
profileEducationId: educationId,
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue