refactoring: WIP payment receive and made form.

This commit is contained in:
a.bouhuolia
2021-02-16 14:03:43 +02:00
parent f6456db592
commit a75177b9d1
47 changed files with 1331 additions and 1723 deletions

View File

@@ -58,7 +58,7 @@ export function useEditPaymentReceive(props) {
const client = useQueryClient();
return useMutation(
(id, values) => ApiService.post(`sales/payment_receives/${id}`, values),
([id, values]) => ApiService.post(`sales/payment_receives/${id}`, values),
{
onSuccess: () => {
client.invalidateQueries('PAYMENT_RECEIVES');
@@ -92,7 +92,10 @@ export function usePaymentReceive(id, props) {
const states = useQuery(
['PAYMENT_RECEIVE', id],
() => ApiService.get(`sales/payment_receives/${id}`),
props,
{
select: (res) => res.data.payment_receive,
...props
},
);
return {