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/ProfileFamilyMother";
import { ProfileFamilyMotherHistory } from "../entities/ProfileFamilyMotherHistory";
import Extension from "../interfaces/extension";
import permission from "../interfaces/permission";
@Route("api/v1/org/profile/family/mother")
@Tags("ProfileFamilyMother")
@Security("bearerAuth")
@ -205,6 +206,7 @@ export class ProfileFamilyMotherController extends Controller {
@Request() req: RequestWithUser,
@Body() body: CreateProfileFamilyMother,
) {
await new permission().PermissionCreate(req,"SYS_REGISTRY");
const familyMother = Object.assign(new ProfileFamilyMother(), body);
if (!familyMother) {
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
@ -245,6 +247,7 @@ export class ProfileFamilyMotherController extends Controller {
@Body() body: UpdateProfileFamilyMother,
@Path() profileId: string,
) {
await new permission().PermissionUpdate(req,"SYS_REGISTRY");
const familyMother = await this.ProfileFamilyMother.findOneBy({ profileId: profileId });
if (!familyMother) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");