mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 21:30:31 +00:00
wip
This commit is contained in:
@@ -96,7 +96,22 @@ export function useBulkDeleteManualJournals(props) {
|
||||
const apiRequest = useApiRequest();
|
||||
|
||||
return useMutation(
|
||||
(ids: number[]) => apiRequest.post('manual-journals/bulk-delete', { ids }),
|
||||
({
|
||||
ids,
|
||||
skipUndeletable = false,
|
||||
}: {
|
||||
ids: number[];
|
||||
skipUndeletable?: boolean;
|
||||
}) =>
|
||||
apiRequest.post(
|
||||
'manual-journals/bulk-delete',
|
||||
{ ids },
|
||||
{
|
||||
params: skipUndeletable
|
||||
? { skip_undeletable: true }
|
||||
: undefined,
|
||||
},
|
||||
),
|
||||
{
|
||||
onSuccess: () => {
|
||||
// Common invalidate queries.
|
||||
@@ -107,6 +122,20 @@ export function useBulkDeleteManualJournals(props) {
|
||||
);
|
||||
}
|
||||
|
||||
export function useValidateBulkDeleteManualJournals(props) {
|
||||
const apiRequest = useApiRequest();
|
||||
|
||||
return useMutation(
|
||||
(ids: number[]) =>
|
||||
apiRequest
|
||||
.post('manual-journals/validate-bulk-delete', { ids })
|
||||
.then((res) => transformToCamelCase(res.data)),
|
||||
{
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Publishes the given manual journal.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user