แก้api ลูกจ้างประจำ

This commit is contained in:
JoolsoftAdmin 2024-08-13 11:03:42 +07:00
parent ab138c2e04
commit 23e5d4f7fe
44 changed files with 7960 additions and 79 deletions

View file

@ -99,12 +99,12 @@ export class ProfileAddressEmployeeController extends Controller {
*/
@Get("history/user")
public async getProfileAddressHistoryUser(@Request() request: RequestWithUser) {
const profile = await this.profileEmployeeRepo.findOneBy({ keycloak: request.user.sub });
if (!profile) {
throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว");
}
const profile = await this.profileEmployeeRepo.findOneBy({ keycloak: request.user.sub });
if (!profile) {
throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว");
}
const record = await this.profileAddressHistoryRepo.find({
where: { profileEmployeeId: profile.id},
where: { profileEmployeeId: profile.id },
relations: {
registrationProvince: true,
registrationDistrict: true,
@ -183,7 +183,7 @@ export class ProfileAddressEmployeeController extends Controller {
@Request() req: RequestWithUser,
@Path() profileId: string,
) {
await new permission().PermissionUpdate(req,"SYS_REGISTRY_EMP");
await new permission().PermissionUpdate(req, "SYS_REGISTRY_EMP");
const record = await this.profileEmployeeRepo.findOneBy({ id: profileId });
if (!record) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");