mirror of
https://github.com/r-ca/kidshift-be.git
synced 2024-10-25 16:14:02 +00:00
検索時にisPaidを考慮するように, 結果にisPaidを含むように
This commit is contained in:
parent
151efacbfe
commit
42df3b4369
|
@ -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,
|
||||
};
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user