mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 05:40:31 +00:00
fix: bill, payment made, receipt loading state.
This commit is contained in:
@@ -17,12 +17,12 @@ const BillFormContext = createContext();
|
||||
*/
|
||||
function BillFormProvider({ billId, ...props }) {
|
||||
// Handle fetch accounts.
|
||||
const { data: accounts, isFetching: isAccountsLoading } = useAccounts();
|
||||
const { data: accounts, isLoading: isAccountsLoading } = useAccounts();
|
||||
|
||||
// Handle fetch vendors data table
|
||||
const {
|
||||
data: { vendors },
|
||||
isFetching: isVendorsLoading,
|
||||
isLoading: isVendorsLoading,
|
||||
} = useVendors({ page_size: 10000 });
|
||||
|
||||
// Filter all purchasable items only.
|
||||
@@ -38,14 +38,14 @@ function BillFormProvider({ billId, ...props }) {
|
||||
// Handle fetch Items data table or list
|
||||
const {
|
||||
data: { items },
|
||||
isFetching: isItemsLoading,
|
||||
isLoading: isItemsLoading,
|
||||
} = useItems({
|
||||
page_size: 10000,
|
||||
stringified_filter_roles: stringifiedFilterRoles,
|
||||
});
|
||||
|
||||
// Handle fetch bill details.
|
||||
const { data: bill, isFetching: isBillLoading } = useBill(billId, {
|
||||
const { data: bill, isLoading: isBillLoading } = useBill(billId, {
|
||||
enabled: !!billId,
|
||||
});
|
||||
|
||||
|
||||
@@ -86,7 +86,6 @@ function PaymentMadeFormProvider({ paymentMadeId, ...props }) {
|
||||
isVendorsLoading ||
|
||||
isItemsFetching ||
|
||||
isAccountsLoading ||
|
||||
isPaymentFetching ||
|
||||
isPaymentLoading
|
||||
}
|
||||
name={'payment-made'}
|
||||
|
||||
@@ -17,19 +17,19 @@ const ReceiptFormContext = createContext();
|
||||
*/
|
||||
function ReceiptFormProvider({ receiptId, ...props }) {
|
||||
// Fetch sale receipt details.
|
||||
const { data: receipt, isFetching: isReceiptLoading } = useReceipt(
|
||||
const { data: receipt, isLoading: isReceiptLoading } = useReceipt(
|
||||
receiptId,
|
||||
{
|
||||
enabled: !!receiptId,
|
||||
},
|
||||
);
|
||||
// Fetch accounts list.
|
||||
const { data: accounts, isFetching: isAccountsLoading } = useAccounts();
|
||||
const { data: accounts, isLoading: isAccountsLoading } = useAccounts();
|
||||
|
||||
// Fetch customers list.
|
||||
const {
|
||||
data: { customers },
|
||||
isFetching: isCustomersLoading,
|
||||
isLoading: isCustomersLoading,
|
||||
} = useCustomers({ page_size: 10000 });
|
||||
|
||||
// Filter all sellable items only.
|
||||
@@ -45,7 +45,7 @@ function ReceiptFormProvider({ receiptId, ...props }) {
|
||||
// Handle fetch Items data table or list
|
||||
const {
|
||||
data: { items },
|
||||
isFetching: isItemsLoading,
|
||||
isLoading: isItemsLoading,
|
||||
} = useItems({
|
||||
page_size: 10000,
|
||||
stringified_filter_roles: stringifiedFilterRoles,
|
||||
|
||||
Reference in New Issue
Block a user