get profile by token
This commit is contained in:
parent
58fe2f08fd
commit
85f8fbb03a
5 changed files with 124 additions and 59 deletions
|
|
@ -548,6 +548,28 @@ export class ProfileController extends Controller {
|
|||
return new HttpSuccess();
|
||||
}
|
||||
|
||||
/**
|
||||
* API รายละเอียดรายการทะเบียนประวัติ
|
||||
*
|
||||
* @summary ORG_065 - รายละเอียดรายการทะเบียนประวัติ (ADMIN) #70
|
||||
*
|
||||
* @param {string} id Id ทะเบียนประวัติ
|
||||
*/
|
||||
@Get("user")
|
||||
async getProfileByUser(@Request() request: RequestWithUser) {
|
||||
const profile = await this.profileRepo.findOne({
|
||||
relations: {
|
||||
posLevel: true,
|
||||
posType: true,
|
||||
},
|
||||
where: { keycloak: request.user.sub },
|
||||
});
|
||||
|
||||
if (!profile) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
|
||||
return new HttpSuccess(profile);
|
||||
}
|
||||
|
||||
/**
|
||||
* API รายละเอียดรายการทะเบียนประวัติ
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue