diff --git a/src/controllers/ProfileSalaryEmployeeController.ts b/src/controllers/ProfileSalaryEmployeeController.ts index 54c475e7..19331c24 100644 --- a/src/controllers/ProfileSalaryEmployeeController.ts +++ b/src/controllers/ProfileSalaryEmployeeController.ts @@ -49,7 +49,10 @@ export class ProfileSalaryEmployeeController extends Controller { @Get("{profileId}") public async getSalaryEmployee(@Path() profileId: string, @Request() req: RequestWithUser) { - await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_EMP", profileId); + const _record = await this.salaryRepo.findOneBy({ id: profileId }); + if (_record) { + await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_EMP", profileId); + } const record = await this.salaryRepo.find({ where: { profileEmployeeId: profileId }, order: { order: "ASC" },