mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 05:10:31 +00:00
fix: logo style.
fix: page forms style. feat: auto-fill items entries from item details. fix: hiding dashboard copyright bar.
This commit is contained in:
@@ -13,9 +13,11 @@ export function useCreateInvoice(props) {
|
||||
return useMutation((values) => apiRequest.post('sales/invoices', values), {
|
||||
onSuccess: (values) => {
|
||||
queryClient.invalidateQueries('SALE_INVOICES');
|
||||
queryClient.invalidateQueries(['SETTINGS', 'INVOICES']);
|
||||
|
||||
queryClient.invalidateQueries('CUSTOMERS');
|
||||
queryClient.invalidateQueries(['CUSTOMER', values.customer_id]);
|
||||
|
||||
queryClient.invalidateQueries(['SETTINGS', 'INVOICES']);
|
||||
},
|
||||
...props,
|
||||
});
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { useEffect } from 'react';
|
||||
import { useQuery, useMutation, useQueryClient } from 'react-query';
|
||||
import { useDispatch } from 'react-redux';
|
||||
import useApiRequest from '../useRequest';
|
||||
@@ -22,7 +23,7 @@ function useSettingsQuery(key, query, props) {
|
||||
const dispatch = useDispatch();
|
||||
const apiRequest = useApiRequest();
|
||||
|
||||
return useQuery(
|
||||
const state = useQuery(
|
||||
key,
|
||||
() => apiRequest.get('settings', { params: query }),
|
||||
{
|
||||
@@ -33,12 +34,17 @@ function useSettingsQuery(key, query, props) {
|
||||
settings: [],
|
||||
},
|
||||
},
|
||||
onSuccess: (settings) => {
|
||||
dispatch({ type: t.SETTING_SET, options: settings });
|
||||
},
|
||||
...props,
|
||||
},
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
if (typeof state.data !== 'undefined') {
|
||||
dispatch({ type: t.SETTING_SET, options: state.data });
|
||||
}
|
||||
}, [state.data, dispatch]);
|
||||
|
||||
return state.data;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user