feat(CreditNotePdf): credit note pdf preview.

This commit is contained in:
elforjani13
2022-01-11 14:33:51 +02:00
parent 76d6cd0eaa
commit dd7d11ffb7
4 changed files with 110 additions and 0 deletions

View File

@@ -2,6 +2,7 @@ import { useQueryClient, useMutation } from 'react-query';
import { useRequestQuery } from '../useQueryRequest';
import { transformPagination } from 'utils';
import useApiRequest from '../useRequest';
import { useRequestPdf } from '../utils';
import t from './types';
const commonInvalidateQueries = (queryClient) => {
@@ -341,3 +342,10 @@ export function useRefundCreditTransaction(id, props, requestProps) {
},
);
}
/**
* Retrieve the credit note pdf document data,
*/
export function usePdfCreditNote(creditNoteId) {
return useRequestPdf(`sales/credit_notes/${creditNoteId}`);
}