permission ทะเบียนประวัติขรก.+ลูกจ้าง
This commit is contained in:
parent
be7f719fd5
commit
9f5987d968
44 changed files with 191 additions and 75 deletions
|
|
@ -26,7 +26,7 @@ import HttpError from "../interfaces/http-error";
|
|||
import HttpStatus from "../interfaces/http-status";
|
||||
import HttpSuccess from "../interfaces/http-success";
|
||||
import { ProfileEmployee } from "../entities/ProfileEmployee";
|
||||
|
||||
import permission from "../interfaces/permission";
|
||||
@Route("api/v1/org/profile-employee/ability")
|
||||
@Tags("ProfileAbilityEmployee")
|
||||
@Security("bearerAuth")
|
||||
|
|
@ -136,6 +136,7 @@ export class ProfileAbilityEmployeeController extends Controller {
|
|||
@Request() req: RequestWithUser,
|
||||
@Body() body: CreateProfileAbilityEmployee,
|
||||
) {
|
||||
await new permission().PermissionCreate(req,"SYS_REGISTRY_EMP");
|
||||
if (!body.profileEmployeeId) {
|
||||
throw new HttpError(HttpStatus.BAD_REQUEST, "กรุณากรอก profileEmployeeId");
|
||||
}
|
||||
|
|
@ -166,6 +167,7 @@ export class ProfileAbilityEmployeeController extends Controller {
|
|||
@Request() req: RequestWithUser,
|
||||
@Path() abilityId: string,
|
||||
) {
|
||||
await new permission().PermissionUpdate(req,"SYS_REGISTRY_EMP");
|
||||
const record = await this.profileAbilityRepo.findOneBy({ id: abilityId });
|
||||
if (!record) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
|
||||
|
|
@ -187,7 +189,8 @@ export class ProfileAbilityEmployeeController extends Controller {
|
|||
}
|
||||
|
||||
@Delete("{abilityId}")
|
||||
public async deleteProfileAbility(@Path() abilityId: string) {
|
||||
public async deleteProfileAbility(@Path() abilityId: string, @Request() req: RequestWithUser) {
|
||||
await new permission().PermissionDelete(req,"SYS_REGISTRY_EMP");
|
||||
await this.profileAbilityHistoryRepo.delete({
|
||||
profileAbilityId: abilityId,
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue