mirror of
https://github.com/r-ca/kidshift-be.git
synced 2024-10-26 00:24: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({
|
return prisma.taskCompletion.findMany({
|
||||||
where: {
|
where: {
|
||||||
child_id: childId,
|
child_id: childId,
|
||||||
|
...(containPaid ? {} : { is_paid: false }),
|
||||||
},
|
},
|
||||||
}).then((histories) => {
|
}).then((histories) => {
|
||||||
if (!histories) {
|
if (!histories) {
|
||||||
|
@ -15,7 +16,8 @@ async function getHistories(childId: string, containPaid: boolean): Promise<Hist
|
||||||
id: history.id,
|
id: history.id,
|
||||||
childId: history.child_id,
|
childId: history.child_id,
|
||||||
taskId: history.task_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