fix: credit & vendor reducer.

This commit is contained in:
elforjani13
2021-12-04 22:16:36 +02:00
parent e1a3f471cb
commit bf99bda616
22 changed files with 142 additions and 139 deletions

View File

@@ -88,7 +88,7 @@ export function useDeleteCreditNote(props) {
});
}
const transformInvoices = (res) => ({
const transformCreditNotes = (res) => ({
creditNotes: res.data.credit_notes,
pagination: transformPagination(res.data.pagination),
filterMeta: res.data.filter_meta,
@@ -102,7 +102,7 @@ export function useCreditNotes(query, props) {
[t.CREDIT_NOTES, query],
{ method: 'get', url: 'sales/credit_notes', params: query },
{
select: transformInvoices,
select: transformCreditNotes,
defaultData: {
creditNotes: [],
pagination: {
@@ -117,30 +117,6 @@ export function useCreditNotes(query, props) {
);
}
// export function useCreditNotes(query, props) {
// return useRequestQuery(
// [t.CREDIT_NOTES],
// {
// method: 'get',
// url: 'sales/credit_notes',
// params: query,
// },
// {
// select: transformVendorCreditsResponse,
// defaultData: {
// credit_notes: {},
// pagination: {
// page: 1,
// page_size: 12,
// total: 0,
// },
// filterMeta: {},
// },
// ...props,
// },
// );
// }
/**
* Retrieve credit note detail of the given id.
* @param {number} id