fix profile_devlopment

This commit is contained in:
AdisakKanthawilang 2024-08-28 17:05:27 +07:00
parent ff8917195f
commit f1c9320bac
3 changed files with 5 additions and 5 deletions

View file

@ -62,7 +62,7 @@ export class ProfileDevelopmentController extends Controller {
], ],
}) })
public async getDevelopment(@Path() profileId: string, @Request() req: RequestWithUser) { public async getDevelopment(@Path() profileId: string, @Request() req: RequestWithUser) {
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId); await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_OFFICER", profileId);
const lists = await this.developmentRepository.find({ const lists = await this.developmentRepository.find({
where: { profileId: profileId }, where: { profileId: profileId },
}); });
@ -113,7 +113,7 @@ export class ProfileDevelopmentController extends Controller {
if (!profile) { if (!profile) {
throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว"); throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว");
} }
await new permission().PermissionOrgUserCreate(req, "SYS_REGISTRY_OFFICER", profile.id); await new permission().PermissionOrgUserUpdate(req, "SYS_REGISTRY_OFFICER", profile.id);
const data = new ProfileDevelopment(); const data = new ProfileDevelopment();

View file

@ -58,7 +58,7 @@ export class ProfileDevelopmentEmployeeController extends Controller {
public async developmentHistory(@Path() developmentId: string, @Request() req: RequestWithUser) { public async developmentHistory(@Path() developmentId: string, @Request() req: RequestWithUser) {
const _record = await this.developmentRepository.findOneBy({ id: developmentId }); const _record = await this.developmentRepository.findOneBy({ id: developmentId });
if (_record) { if (_record) {
await new permission().PermissionOrgUserDelete( await new permission().PermissionOrgUserList(
req, req,
"SYS_REGISTRY_EMP", "SYS_REGISTRY_EMP",
_record.profileEmployeeId, _record.profileEmployeeId,
@ -84,7 +84,7 @@ export class ProfileDevelopmentEmployeeController extends Controller {
if (!profile) { if (!profile) {
throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว"); throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว");
} }
await new permission().PermissionOrgUserCreate(req, "SYS_REGISTRY_EMP", profile.id); await new permission().PermissionOrgUserUpdate(req, "SYS_REGISTRY_EMP", profile.id);
const data = new ProfileDevelopment(); const data = new ProfileDevelopment();

View file

@ -69,7 +69,7 @@ export class ProfileDevelopmentEmployeeTempController extends Controller {
@Request() req: RequestWithUser, @Request() req: RequestWithUser,
@Body() body: CreateProfileEmployeeDevelopment, @Body() body: CreateProfileEmployeeDevelopment,
) { ) {
await new permission().PermissionCreate(req, "SYS_REGISTRY_TEMP"); await new permission().PermissionUpdate(req, "SYS_REGISTRY_TEMP");
if (!body.profileEmployeeId) { if (!body.profileEmployeeId) {
throw new HttpError(HttpStatus.BAD_REQUEST, "กรุณากรอก profileId"); throw new HttpError(HttpStatus.BAD_REQUEST, "กรุณากรอก profileId");
} }