แก้ชื่อสิท
This commit is contained in:
parent
828dd2a37d
commit
ab138c2e04
23 changed files with 77 additions and 67 deletions
|
|
@ -133,7 +133,7 @@ export class ProfileAbilityController extends Controller {
|
|||
@Request() req: RequestWithUser,
|
||||
@Body() body: CreateProfileAbility,
|
||||
) {
|
||||
await new permission().PermissionCreate(req,"SYS_REGISTRY");
|
||||
await new permission().PermissionCreate(req, "SYS_REGISTRY_OFFICER");
|
||||
if (!body.profileId) {
|
||||
throw new HttpError(HttpStatus.BAD_REQUEST, "กรุณากรอก profileId");
|
||||
}
|
||||
|
|
@ -164,7 +164,7 @@ export class ProfileAbilityController extends Controller {
|
|||
@Request() req: RequestWithUser,
|
||||
@Path() abilityId: string,
|
||||
) {
|
||||
await new permission().PermissionUpdate(req,"SYS_REGISTRY");
|
||||
await new permission().PermissionUpdate(req, "SYS_REGISTRY_OFFICER");
|
||||
const record = await this.profileAbilityRepo.findOneBy({ id: abilityId });
|
||||
if (!record) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
|
||||
|
|
@ -186,12 +186,12 @@ export class ProfileAbilityController extends Controller {
|
|||
}
|
||||
|
||||
@Delete("{abilityId}")
|
||||
public async deleteProfileAbility(@Path() abilityId: string, @Request() req: RequestWithUser,) {
|
||||
await new permission().PermissionDelete(req,"SYS_REGISTRY");
|
||||
public async deleteProfileAbility(@Path() abilityId: string, @Request() req: RequestWithUser) {
|
||||
await new permission().PermissionDelete(req, "SYS_REGISTRY_OFFICER");
|
||||
await this.profileAbilityHistoryRepo.delete({
|
||||
profileAbilityId: abilityId,
|
||||
});
|
||||
|
||||
|
||||
const result = await this.profileAbilityRepo.delete({ id: abilityId });
|
||||
|
||||
if (result.affected == undefined || result.affected <= 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue