refactoring: invoice form.

refactoring: receipt form.
refactoring: bill form.
refactoring: estimate form.
This commit is contained in:
a.bouhuolia
2021-02-15 16:23:58 +02:00
parent 151bd9bc54
commit e8458e2b36
37 changed files with 410 additions and 903 deletions

View File

@@ -25,7 +25,7 @@ export function useEditBill(props) {
const queryClient = useQueryClient();
return useMutation(
(id, values) => ApiService.post(`purchases/bills/${id}`, values),
([id, values]) => ApiService.post(`purchases/bills/${id}`, values),
{
onSuccess: () => {
queryClient.invalidateQueries('BILLS');
@@ -97,7 +97,10 @@ export function useBill(id, props) {
}
);
return defaultTo(states.data, {});
return {
...states,
data: defaultTo(states.data, {}),
}
}
/**