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

@ -21,6 +21,7 @@ import { ProfileEmployee } from "../entities/ProfileEmployee";
import { ProfileFamilyMother, CreateProfileEmployeeFamilyMother, UpdateProfileFamilyMother } from "../entities/ProfileFamilyMother";
import { ProfileFamilyMotherHistory } from "../entities/ProfileFamilyMotherHistory";
import Extension from "../interfaces/extension";
import permission from "../interfaces/permission";
@Route("api/v1/org/profile-employee/family/mother")
@Tags("ProfileEmployeeFamilyMother")
@Security("bearerAuth")
@ -201,6 +202,7 @@ export class ProfileFamilyMotherEmployeeController extends Controller {
@Request() req: RequestWithUser,
@Body() body: CreateProfileEmployeeFamilyMother,
) {
await new permission().PermissionCreate(req,"SYS_REGISTRY_EMP");
const familyMother = Object.assign(new ProfileFamilyMother(), body);
if (!familyMother) {
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
@ -241,6 +243,7 @@ export class ProfileFamilyMotherEmployeeController extends Controller {
@Body() body: UpdateProfileFamilyMother,
@Path() profileEmployeeId: string,
) {
await new permission().PermissionUpdate(req,"SYS_REGISTRY_EMP");
const familyMother = await this.ProfileFamilyMother.findOneBy({
profileEmployeeId: profileEmployeeId,
});