mirror of
https://github.com/rgrgogu/new_starr.git
synced 2026-09-27 00:12:54 +08:00
fix query from payment per tier plan
This commit is contained in:
@@ -72,7 +72,7 @@ export default function PaymentsTable({ planId = null }) {
|
||||
// Pass planId as a locked filter to DataTable's onFetch
|
||||
const handleFetch = useCallback((params = {}) => {
|
||||
const baseFilters = planId
|
||||
? [{ field: "plan_id", value: planId }, ...(params.filters ?? [])]
|
||||
? [{ id: "plan_id", value: planId }, ...(params.filters ?? [])]
|
||||
: (params.filters ?? []);
|
||||
fetchPayments({ ...params, filters: baseFilters });
|
||||
}, [planId, fetchPayments]);
|
||||
|
||||
@@ -13,7 +13,7 @@ export default function PaymentList() {
|
||||
|
||||
useEffect(() => {
|
||||
fetchPayments({
|
||||
filters: planId ? [{ field: "plan_id", value: planId }] : [],
|
||||
filters: planId ? [{ id: "plan_id", value: planId }] : [],
|
||||
});
|
||||
}, [planId]);
|
||||
|
||||
|
||||
@@ -722,7 +722,7 @@ function PaymentsTab({ planId }) {
|
||||
const { fetchPayments } = useTiers();
|
||||
|
||||
useEffect(() => {
|
||||
fetchPayments({ filters: [{ field: "plan_id", value: planId }] });
|
||||
fetchPayments({ filters: [{ id: "plan_id", value: planId }] });
|
||||
}, [planId]);
|
||||
|
||||
return <PaymentsTable planId={planId} />;
|
||||
|
||||
Reference in New Issue
Block a user