Skip to content

Commit

Permalink
🐛 fix: fetch only current citizen records
Browse files Browse the repository at this point in the history
  • Loading branch information
casperiv0 committed Mar 23, 2023
1 parent 8e4f69d commit 3a9abea
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion apps/api/src/controllers/citizen/CitizenController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,10 @@ export class CitizenController {
defaultReturn: false,
});

const records = await prisma.record.findMany(RecordsInclude(isEnabled));
const records = await prisma.record.findMany({
...RecordsInclude(isEnabled),
where: { ...RecordsInclude(isEnabled).where, citizenId: citizen.id },
});
return records;
}

Expand Down

0 comments on commit 3a9abea

Please sign in to comment.