permission ทะเบียนประวัติขรก.+ลูกจ้าง

This commit is contained in:
Bright 2024-08-08 17:15:21 +07:00
parent be7f719fd5
commit 9f5987d968
44 changed files with 191 additions and 75 deletions

View file

@ -25,6 +25,7 @@ import {
} from "../entities/ProfileFamilyFather";
import { ProfileFamilyFatherHistory } from "../entities/ProfileFamilyFatherHistory";
import Extension from "../interfaces/extension";
import permission from "../interfaces/permission";
@Route("api/v1/org/profile/family/father")
@Tags("ProfileFamilyFather")
@Security("bearerAuth")
@ -205,6 +206,7 @@ export class ProfileFamilyFatherController extends Controller {
@Request() req: RequestWithUser,
@Body() body: CreateProfileFamilyFather,
) {
await new permission().PermissionCreate(req,"SYS_REGISTRY");
const familyFather = Object.assign(new ProfileFamilyFather(), body);
if (!familyFather) {
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
@ -245,6 +247,7 @@ export class ProfileFamilyFatherController extends Controller {
@Body() body: UpdateProfileFamilyFather,
@Path() profileId: string,
) {
await new permission().PermissionUpdate(req,"SYS_REGISTRY");
const familyFather = await this.ProfileFamilyFather.findOneBy({ profileId: profileId });
if (!familyFather) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");