diff --git a/src/controllers/ProfileController.ts b/src/controllers/ProfileController.ts index 77d6ac21..8f064746 100644 --- a/src/controllers/ProfileController.ts +++ b/src/controllers/ProfileController.ts @@ -873,6 +873,21 @@ export class ProfileController extends Controller { return new HttpSuccess(profile); } + @Get("keycloak/{id}") + async getProfileByKeycloakId(@Path() id: string) { + const profile = await this.profileRepo.findOne({ + relations: { + posLevel: true, + posType: true, + }, + where: { keycloak: id }, + }); + + if (!profile) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล"); + + return new HttpSuccess(profile); + } + @Get("history/{id}") async getProfileHistory(@Path() id: string) { const profile = await this.profileHistoryRepo.find({