fix: insignia relations

This commit is contained in:
Methapon2001 2024-03-18 18:03:01 +07:00
parent 8339c55472
commit b0292f3921
4 changed files with 74 additions and 186 deletions

View file

@ -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);
}