mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 04:40:32 +00:00
feat: payment received mail receipt preview
This commit is contained in:
@@ -301,3 +301,35 @@ export function usePaymentReceivedState(
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
interface PaymentReceivedHtmlResponse {
|
||||
htmlContent: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the html content of the given payment receive.
|
||||
* @param {number} paymentReceivedId
|
||||
* @param {UseQueryOptions<PaymentReceivedHtmlResponse, Error>} options
|
||||
* @returns {UseQueryResult<PaymentReceivedHtmlResponse, Error>}
|
||||
*/
|
||||
export function useGetPaymentReceiveHtml(
|
||||
paymentReceivedId: number,
|
||||
options?: UseQueryOptions<PaymentReceivedHtmlResponse, Error>,
|
||||
): UseQueryResult<PaymentReceivedHtmlResponse, Error> {
|
||||
const apiRequest = useApiRequest();
|
||||
|
||||
return useQuery<PaymentReceivedHtmlResponse, Error>(
|
||||
['PAYMENT_RECEIVED_HTML', paymentReceivedId],
|
||||
() =>
|
||||
apiRequest
|
||||
.get(`/sales/payment_receives/${paymentReceivedId}`, {
|
||||
headers: {
|
||||
Accept: 'application/json+html',
|
||||
},
|
||||
})
|
||||
.then((res) => transformToCamelCase(res.data)),
|
||||
{
|
||||
...options,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user