Refactor code structure for improved readability and maintainability
This commit is contained in:
@@ -72,6 +72,8 @@ export function usePayments(filters: PaymentFilters) {
|
||||
return useQuery<PaginatedResponse<PaymentRow>>({
|
||||
queryKey: ['payments', filters],
|
||||
queryFn: () => api.get(`/api/v1/my/billing/payments?${qs.toString()}`),
|
||||
// ورود دوباره به صفحه همیشه داده را تازه میکند (پرداختها لحظهای عوض میشوند).
|
||||
refetchOnMount: 'always',
|
||||
});
|
||||
}
|
||||
|
||||
@@ -93,6 +95,7 @@ export function usePaymentsSummary(filters: Omit<PaymentFilters, 'page'>) {
|
||||
return useQuery<ApiResponse<PaymentsSummary>>({
|
||||
queryKey: ['payments-summary', filters],
|
||||
queryFn: () => api.get(`/api/v1/my/billing/payments/summary?${qs.toString()}`),
|
||||
refetchOnMount: 'always',
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user