แก้api ลูกจ้างประจำ
This commit is contained in:
parent
ab138c2e04
commit
23e5d4f7fe
44 changed files with 7960 additions and 79 deletions
|
|
@ -138,8 +138,11 @@ export class ProfileTrainingEmployeeController extends Controller {
|
|||
}
|
||||
|
||||
@Post()
|
||||
public async newTraining(@Request() req: RequestWithUser, @Body() body: CreateProfileEmployeeTraining) {
|
||||
await new permission().PermissionCreate(req,"SYS_REGISTRY_EMP");
|
||||
public async newTraining(
|
||||
@Request() req: RequestWithUser,
|
||||
@Body() body: CreateProfileEmployeeTraining,
|
||||
) {
|
||||
await new permission().PermissionCreate(req, "SYS_REGISTRY_EMP");
|
||||
if (!body.profileEmployeeId) {
|
||||
throw new HttpError(HttpStatus.BAD_REQUEST, "กรุณากรอก profileEmployeeId");
|
||||
}
|
||||
|
|
@ -172,7 +175,7 @@ export class ProfileTrainingEmployeeController extends Controller {
|
|||
@Body() body: UpdateProfileTraining,
|
||||
@Path() trainingId: string,
|
||||
) {
|
||||
await new permission().PermissionUpdate(req,"SYS_REGISTRY_EMP");
|
||||
await new permission().PermissionUpdate(req, "SYS_REGISTRY_EMP");
|
||||
const record = await this.trainingRepo.findOneBy({ id: trainingId });
|
||||
|
||||
if (!record) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
|
|
@ -192,7 +195,7 @@ export class ProfileTrainingEmployeeController extends Controller {
|
|||
|
||||
@Delete("{trainingId}")
|
||||
public async deleteTraining(@Path() trainingId: string, @Request() req: RequestWithUser) {
|
||||
await new permission().PermissionDelete(req,"SYS_REGISTRY_EMP");
|
||||
await new permission().PermissionDelete(req, "SYS_REGISTRY_EMP");
|
||||
await this.trainingHistoryRepo.delete({
|
||||
profileTrainingId: trainingId,
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue