mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 12:50:38 +00:00
feat: notify by SMS.
This commit is contained in:
@@ -219,14 +219,52 @@ export function useCancelBadDebt(props) {
|
||||
const queryClient = useQueryClient();
|
||||
const apiRequest = useApiRequest();
|
||||
|
||||
return useMutation((id) => apiRequest.post(`sales/invoices/${id}/writeoff/cancel`), {
|
||||
onSuccess: (res, id) => {
|
||||
// Invalidate
|
||||
queryClient.invalidateQueries([t.CANCEL_BAD_DEBT, id]);
|
||||
return useMutation(
|
||||
(id) => apiRequest.post(`sales/invoices/${id}/writeoff/cancel`),
|
||||
{
|
||||
onSuccess: (res, id) => {
|
||||
// Invalidate
|
||||
queryClient.invalidateQueries([t.CANCEL_BAD_DEBT, id]);
|
||||
|
||||
// Common invalidate queries.
|
||||
commonInvalidateQueries(queryClient);
|
||||
// Common invalidate queries.
|
||||
commonInvalidateQueries(queryClient);
|
||||
},
|
||||
...props,
|
||||
},
|
||||
...props,
|
||||
});
|
||||
);
|
||||
}
|
||||
|
||||
export function useCreateNotifyInvoiceBySMS(props) {
|
||||
const queryClient = useQueryClient();
|
||||
const apiRequest = useApiRequest();
|
||||
|
||||
return useMutation(
|
||||
(id) => apiRequest.post(`sales/invoices/${id}/notify-by-sms`),
|
||||
{
|
||||
onSuccess: (res, id) => {
|
||||
// Invalidate
|
||||
queryClient.invalidateQueries([t.NOTIFY_SALE_INVOICE_BY_SMS, id]);
|
||||
|
||||
// Common invalidate queries.
|
||||
commonInvalidateQueries(queryClient);
|
||||
},
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export function useInvocieSMSDetails(invoiceId, props, requestProps) {
|
||||
return useRequestQuery(
|
||||
[t.SALE_INVOICE_SMS, invoiceId],
|
||||
{
|
||||
method: 'get',
|
||||
url: `sales/invoices/${invoiceId}/sms-details`,
|
||||
...requestProps,
|
||||
},
|
||||
{
|
||||
select: (res) => res.data.data,
|
||||
defaultData: {},
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user