検索時にisPaidを考慮するように, 結果にisPaidを含むように

This commit is contained in:
rca 2024-07-21 01:49:00 +09:00
parent 151efacbfe
commit 42df3b4369

View File

@ -5,6 +5,7 @@ async function getHistories(childId: string, containPaid: boolean): Promise<Hist
return prisma.taskCompletion.findMany({
where: {
child_id: childId,
...(containPaid ? {} : { is_paid: false }),
},
}).then((histories) => {
if (!histories) {
@ -15,7 +16,8 @@ async function getHistories(childId: string, containPaid: boolean): Promise<Hist
id: history.id,
childId: history.child_id,
taskId: history.task_id,
registeredAt: history.registerd_at
registeredAt: history.registerd_at,
isPaid: history.is_paid,
};
});
});