get ข้อมูล by keycloak
This commit is contained in:
parent
f6bcd35e14
commit
ff0be7af48
22 changed files with 633 additions and 137 deletions
|
|
@ -29,6 +29,18 @@ export class ProfileNopaidController extends Controller {
|
|||
private nopaidRepository = AppDataSource.getRepository(ProfileNopaid);
|
||||
private nopaidHistoryRepository = AppDataSource.getRepository(ProfileNopaidHistory);
|
||||
|
||||
@Get("user")
|
||||
public async getNopaidUser(@Request() request: { user: Record<string, any> }) {
|
||||
const profile = await this.profileRepository.findOneBy({ keycloak: request.user.sub });
|
||||
if (!profile) {
|
||||
throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว");
|
||||
}
|
||||
const lists = await this.nopaidRepository.find({
|
||||
where: { id: profile.id },
|
||||
});
|
||||
return new HttpSuccess(lists);
|
||||
}
|
||||
|
||||
@Get("{profileId}")
|
||||
@Example({
|
||||
status: 200,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue