permission ทะเบียนประวัติขรก.+ลูกจ้าง
This commit is contained in:
parent
be7f719fd5
commit
9f5987d968
44 changed files with 191 additions and 75 deletions
|
|
@ -25,6 +25,7 @@ import {
|
|||
UpdateProfileChildren,
|
||||
} from "../entities/ProfileChildren";
|
||||
import Extension from "../interfaces/extension";
|
||||
import permission from "../interfaces/permission";
|
||||
@Route("api/v1/org/profile/family/children")
|
||||
@Tags("ProfileChildren")
|
||||
@Security("bearerAuth")
|
||||
|
|
@ -64,6 +65,7 @@ export class ProfileChildrenController extends Controller {
|
|||
|
||||
@Post()
|
||||
public async newChildren(@Request() req: RequestWithUser, @Body() body: CreateProfileChildren) {
|
||||
await new permission().PermissionCreate(req,"SYS_REGISTRY");
|
||||
const profile = await this.profileRepository.findOneBy({ id: body.profileId });
|
||||
|
||||
if (!profile) {
|
||||
|
|
@ -106,6 +108,7 @@ export class ProfileChildrenController extends Controller {
|
|||
@Body() body: UpdateProfileChildren,
|
||||
@Path() childrenId: string,
|
||||
) {
|
||||
await new permission().PermissionUpdate(req,"SYS_REGISTRY");
|
||||
const record = await this.childrenRepository.findOneBy({ id: childrenId });
|
||||
if (!record) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
|
||||
|
|
@ -132,7 +135,8 @@ export class ProfileChildrenController extends Controller {
|
|||
}
|
||||
|
||||
@Delete("{childrenId}")
|
||||
public async deleteTraning(@Path() childrenId: string) {
|
||||
public async deleteTraning(@Path() childrenId: string, @Request() req: RequestWithUser,) {
|
||||
await new permission().PermissionDelete(req,"SYS_REGISTRY");
|
||||
await this.childrenHistoryRepository.delete({
|
||||
profileChildrenId: childrenId,
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue