แก้ชื่อสิท
This commit is contained in:
parent
828dd2a37d
commit
ab138c2e04
23 changed files with 77 additions and 67 deletions
|
|
@ -247,7 +247,7 @@ export class ProfileLeaveController extends Controller {
|
|||
|
||||
@Post()
|
||||
public async newLeave(@Request() req: RequestWithUser, @Body() body: CreateProfileLeave) {
|
||||
await new permission().PermissionCreate(req,"SYS_REGISTRY");
|
||||
await new permission().PermissionCreate(req, "SYS_REGISTRY_OFFICER");
|
||||
if (!body.profileId) {
|
||||
throw new HttpError(HttpStatus.BAD_REQUEST, "กรุณากรอก profileId");
|
||||
}
|
||||
|
|
@ -286,7 +286,7 @@ export class ProfileLeaveController extends Controller {
|
|||
@Body() body: UpdateProfileLeave,
|
||||
@Path() leaveId: string,
|
||||
) {
|
||||
await new permission().PermissionUpdate(req,"SYS_REGISTRY");
|
||||
await new permission().PermissionUpdate(req, "SYS_REGISTRY_OFFICER");
|
||||
const record = await this.leaveRepo.findOneBy({ id: leaveId });
|
||||
|
||||
if (!record) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
|
|
@ -313,7 +313,7 @@ export class ProfileLeaveController extends Controller {
|
|||
|
||||
@Delete("{leaveId}")
|
||||
public async deleteLeave(@Path() leaveId: string, @Request() req: RequestWithUser) {
|
||||
await new permission().PermissionDelete(req,"SYS_REGISTRY");
|
||||
await new permission().PermissionDelete(req, "SYS_REGISTRY_OFFICER");
|
||||
await this.leaveHistoryRepo.delete({
|
||||
profileLeaveId: leaveId,
|
||||
});
|
||||
|
|
@ -339,7 +339,7 @@ export class ProfileLeaveController extends Controller {
|
|||
throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว");
|
||||
}
|
||||
const leaveType = await this.leaveTypeRepository.findOne({
|
||||
where: { name: body.leaveTypeId }
|
||||
where: { name: body.leaveTypeId },
|
||||
});
|
||||
if (!leaveType) {
|
||||
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลประเภทลานี้");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue