현금영수증 리스트
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 {
|
||||
CashReceiptReceiptDownloadParams,
|
||||
CashReceiptReceiptDownloadResponse
|
||||
} from '../model/types';
|
||||
import {
|
||||
useMutation,
|
||||
UseMutationOptions
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
export const cashReceiptReceiptDownload = (params: CashReceiptReceiptDownloadParams) => {
|
||||
return resultify(
|
||||
axios.post<CashReceiptReceiptDownloadResponse>(API_URL_TRANSACTION.cashReceiptReceiptDownload(), params),
|
||||
);
|
||||
};
|
||||
|
||||
export const useCashReceiptReceiptDownloadMutation = (options?: UseMutationOptions<CashReceiptReceiptDownloadResponse, CBDCAxiosError, CashReceiptReceiptDownloadParams>) => {
|
||||
const mutation = useMutation<CashReceiptReceiptDownloadResponse, CBDCAxiosError, CashReceiptReceiptDownloadParams>({
|
||||
...options,
|
||||
mutationFn: (params: CashReceiptReceiptDownloadParams) => cashReceiptReceiptDownload(params),
|
||||
});
|
||||
|
||||
return {
|
||||
...mutation,
|
||||
};
|
||||
};
|
||||
@@ -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 {
|
||||
CashReceiptSummaryParams,
|
||||
CashReceiptSummaryResponse
|
||||
} from '../model/types';
|
||||
import {
|
||||
useMutation,
|
||||
UseMutationOptions
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
export const cashReceiptSummary = (params: CashReceiptSummaryParams) => {
|
||||
return resultify(
|
||||
axios.post<CashReceiptSummaryResponse>(API_URL_TRANSACTION.cashReceiptSummary(), params),
|
||||
);
|
||||
};
|
||||
|
||||
export const useCashReceiptSummaryMutation = (options?: UseMutationOptions<CashReceiptSummaryResponse, CBDCAxiosError, CashReceiptSummaryParams>) => {
|
||||
const mutation = useMutation<CashReceiptSummaryResponse, CBDCAxiosError, CashReceiptSummaryParams>({
|
||||
...options,
|
||||
mutationFn: (params: CashReceiptSummaryParams) => cashReceiptSummary(params),
|
||||
});
|
||||
|
||||
return {
|
||||
...mutation,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user