test
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL_TRANSACTION } from '@/shared/api/api-url-transaction';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
CashReceiptPurposeUpdateParams,
|
||||
CashReceiptPurposeUpdateResponse
|
||||
} from '../model/types';
|
||||
import {
|
||||
useMutation,
|
||||
UseMutationOptions
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
export const cashReceiptPurposeUpdate = (params: CashReceiptPurposeUpdateParams) => {
|
||||
return resultify(
|
||||
axios.post<CashReceiptPurposeUpdateResponse>(API_URL_TRANSACTION.cashReceiptPurposeUpdate(), params),
|
||||
);
|
||||
};
|
||||
|
||||
export const useCashReceiptPurposeUpdateMutation = (options?: UseMutationOptions<CashReceiptPurposeUpdateResponse, CBDCAxiosError, CashReceiptPurposeUpdateParams>) => {
|
||||
const mutation = useMutation<CashReceiptPurposeUpdateResponse, CBDCAxiosError, CashReceiptPurposeUpdateParams>({
|
||||
...options,
|
||||
mutationFn: (params: CashReceiptPurposeUpdateParams) => cashReceiptPurposeUpdate(params),
|
||||
});
|
||||
|
||||
return {
|
||||
...mutation,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user