แก้ค้นหาประวัติ by token
This commit is contained in:
parent
ff0be7af48
commit
24c5cbef55
7 changed files with 8 additions and 8 deletions
|
|
@ -41,7 +41,7 @@ export class ProfileAddressController extends Controller {
|
|||
throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว");
|
||||
}
|
||||
const getProfileAddress = await this.profileRepo.findOne({
|
||||
where: { id: request.user.sub },
|
||||
where: { id: profile.id },
|
||||
select: [
|
||||
"id",
|
||||
"registrationAddress",
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ export class ProfileCertificateController extends Controller {
|
|||
private certificateRepo = AppDataSource.getRepository(ProfileCertificate);
|
||||
private certificateHistoryRepo = AppDataSource.getRepository(ProfileCertificateHistory);
|
||||
|
||||
@Get("{profileId}")
|
||||
@Get("user")
|
||||
public async getCertificateUser(@Request() request: { user: Record<string, any> }) {
|
||||
const profile = await this.profileRepo.findOneBy({ keycloak: request.user.sub });
|
||||
if (!profile) {
|
||||
|
|
|
|||
|
|
@ -45,11 +45,11 @@ export class ProfileFamilyHistoryController extends Controller {
|
|||
const family = await this.familyHistoryRepo.find({
|
||||
take: 1,
|
||||
order: { lastUpdatedAt: "DESC" },
|
||||
where: { id: profile.id },
|
||||
where: { profileId: profile.id },
|
||||
});
|
||||
const children = await this.childrenRepo.find({
|
||||
order: { createdAt: "ASC" },
|
||||
where: { id: profile.id },
|
||||
where: { profileId: profile.id },
|
||||
});
|
||||
return new HttpSuccess(
|
||||
family.length > 0
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ export class ProfileFamilyMotherController extends Controller {
|
|||
"motherLive",
|
||||
"profileId",
|
||||
],
|
||||
where: { id: profile.id },
|
||||
where: { profileId: profile.id },
|
||||
order: { lastUpdatedAt: "DESC" },
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ export class ProfileInsigniaController extends Controller {
|
|||
insigniaType: true,
|
||||
},
|
||||
},
|
||||
where: { id: profile.id },
|
||||
where: { profileId: profile.id },
|
||||
});
|
||||
return new HttpSuccess(record);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ export class ProfileLeaveController extends Controller {
|
|||
}
|
||||
const record = await this.leaveRepo.find({
|
||||
relations: { leaveType: true },
|
||||
where: { id: profile.id },
|
||||
where: { profileId: profile.id },
|
||||
});
|
||||
return new HttpSuccess(record);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ export class ProfileNopaidController extends Controller {
|
|||
throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว");
|
||||
}
|
||||
const lists = await this.nopaidRepository.find({
|
||||
where: { id: profile.id },
|
||||
where: { profileId: profile.id },
|
||||
});
|
||||
return new HttpSuccess(lists);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue