fix: insignia relations
This commit is contained in:
parent
8339c55472
commit
b0292f3921
4 changed files with 74 additions and 186 deletions
|
|
@ -66,7 +66,14 @@ export class ProfileInsigniaController extends Controller {
|
|||
],
|
||||
})
|
||||
public async getInsignia(@Path() profileId: string) {
|
||||
const record = await this.insigniaRepo.findBy({ profileId });
|
||||
const record = await this.insigniaRepo.find({
|
||||
relations: {
|
||||
insignia: {
|
||||
insigniaType: true,
|
||||
},
|
||||
},
|
||||
where: { profileId },
|
||||
});
|
||||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
|
|
@ -128,8 +135,15 @@ export class ProfileInsigniaController extends Controller {
|
|||
],
|
||||
})
|
||||
public async getInsigniaHistory(@Path() InsigniaId: string) {
|
||||
const record = await this.insigniaHistoryRepo.findBy({
|
||||
profileInsigniaId: InsigniaId,
|
||||
const record = await this.insigniaHistoryRepo.find({
|
||||
relations: {
|
||||
insignia: {
|
||||
insigniaType: true,
|
||||
},
|
||||
},
|
||||
where: {
|
||||
profileInsigniaId: InsigniaId,
|
||||
},
|
||||
});
|
||||
return new HttpSuccess(record);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue