거래내역 관련
This commit is contained in:
@@ -3,7 +3,7 @@ import { API_URL } from '@/shared/api/urls';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
CashReceitDetailParams,
|
||||
CashReceiptDetailParams,
|
||||
DetailResponse
|
||||
} from '../model/types';
|
||||
import {
|
||||
@@ -11,16 +11,16 @@ import {
|
||||
UseMutationOptions
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
export const cashReceitDetail = (params: CashReceitDetailParams) => {
|
||||
export const cashReceiptDetail = (params: CashReceiptDetailParams) => {
|
||||
return resultify(
|
||||
axios.post<DetailResponse>(API_URL.cashReceitDetail(), params),
|
||||
axios.post<DetailResponse>(API_URL.cashReceiptDetail(), params),
|
||||
);
|
||||
};
|
||||
|
||||
export const useCashReceitDetailMutation = (options?: UseMutationOptions<DetailResponse, CBDCAxiosError, CashReceitDetailParams>) => {
|
||||
const mutation = useMutation<DetailResponse, CBDCAxiosError, CashReceitDetailParams>({
|
||||
export const useCashReceiptDetailMutation = (options?: UseMutationOptions<DetailResponse, CBDCAxiosError, CashReceiptDetailParams>) => {
|
||||
const mutation = useMutation<DetailResponse, CBDCAxiosError, CashReceiptDetailParams>({
|
||||
...options,
|
||||
mutationFn: (params: CashReceitDetailParams) => cashReceitDetail(params),
|
||||
mutationFn: (params: CashReceiptDetailParams) => cashReceiptDetail(params),
|
||||
});
|
||||
|
||||
return {
|
||||
@@ -0,0 +1,29 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL } from '@/shared/api/urls';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
CashReceiptListParams,
|
||||
CashReceiptListResponse
|
||||
} from '../model/types';
|
||||
import {
|
||||
useMutation,
|
||||
UseMutationOptions
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
export const cashReceiptList = (params: CashReceiptListParams) => {
|
||||
return resultify(
|
||||
axios.post<CashReceiptListResponse>(API_URL.cashReceiptList(), params),
|
||||
);
|
||||
};
|
||||
|
||||
export const useCashReceiptListMutation = (options?: UseMutationOptions<CashReceiptListResponse, CBDCAxiosError, CashReceiptListParams>) => {
|
||||
const mutation = useMutation<CashReceiptListResponse, CBDCAxiosError, CashReceiptListParams>({
|
||||
...options,
|
||||
mutationFn: (params: CashReceiptListParams) => cashReceiptList(params),
|
||||
});
|
||||
|
||||
return {
|
||||
...mutation,
|
||||
};
|
||||
};
|
||||
@@ -1,29 +0,0 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL } from '@/shared/api/urls';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
CashReceitListParams,
|
||||
CashReceitListResponse
|
||||
} from '../model/types';
|
||||
import {
|
||||
useMutation,
|
||||
UseMutationOptions
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
export const cashReceitList = (params: CashReceitListParams) => {
|
||||
return resultify(
|
||||
axios.post<CashReceitListResponse>(API_URL.cashReceitList(), params),
|
||||
);
|
||||
};
|
||||
|
||||
export const useCashReceitListMutation = (options?: UseMutationOptions<CashReceitListResponse, CBDCAxiosError, CashReceitListParams>) => {
|
||||
const mutation = useMutation<CashReceitListResponse, CBDCAxiosError, CashReceitListParams>({
|
||||
...options,
|
||||
mutationFn: (params: CashReceitListParams) => cashReceitList(params),
|
||||
});
|
||||
|
||||
return {
|
||||
...mutation,
|
||||
};
|
||||
};
|
||||
@@ -1,29 +0,0 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL } from '@/shared/api/urls';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
CashReceitListSummaryParams,
|
||||
CashReceitListSummaryResponse
|
||||
} from '../model/types';
|
||||
import {
|
||||
useMutation,
|
||||
UseMutationOptions
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
export const cashReceitListSummary = (params: CashReceitListSummaryParams) => {
|
||||
return resultify(
|
||||
axios.post<CashReceitListSummaryResponse>(API_URL.allTransactionListSummary(), params),
|
||||
);
|
||||
};
|
||||
|
||||
export const useCashReceitListSummaryMutation = (options?: UseMutationOptions<CashReceitListSummaryResponse, CBDCAxiosError, CashReceitListSummaryParams>) => {
|
||||
const mutation = useMutation<CashReceitListSummaryResponse, CBDCAxiosError, CashReceitListSummaryParams>({
|
||||
...options,
|
||||
mutationFn: (params: CashReceitListSummaryParams) => cashReceitListSummary(params),
|
||||
});
|
||||
|
||||
return {
|
||||
...mutation,
|
||||
};
|
||||
};
|
||||
@@ -1,29 +0,0 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL } from '@/shared/api/urls';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
EscroListParams,
|
||||
EscroListResponse
|
||||
} from '../model/types';
|
||||
import {
|
||||
useMutation,
|
||||
UseMutationOptions
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
export const escroList = (params: EscroListParams) => {
|
||||
return resultify(
|
||||
axios.post<EscroListResponse>(API_URL.escroList(), params),
|
||||
);
|
||||
};
|
||||
|
||||
export const useEscroListMutation = (options?: UseMutationOptions<EscroListResponse, CBDCAxiosError, EscroListParams>) => {
|
||||
const mutation = useMutation<EscroListResponse, CBDCAxiosError, EscroListParams>({
|
||||
...options,
|
||||
mutationFn: (params: EscroListParams) => escroList(params),
|
||||
});
|
||||
|
||||
return {
|
||||
...mutation,
|
||||
};
|
||||
};
|
||||
@@ -3,7 +3,7 @@ import { API_URL } from '@/shared/api/urls';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
EscroDetailParams,
|
||||
EscrowDetailParams,
|
||||
DetailResponse
|
||||
} from '../model/types';
|
||||
import {
|
||||
@@ -11,16 +11,16 @@ import {
|
||||
UseMutationOptions
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
export const escroDetail = (params: EscroDetailParams) => {
|
||||
export const escrowDetail = (params: EscrowDetailParams) => {
|
||||
return resultify(
|
||||
axios.post<DetailResponse>(API_URL.escroDetail(), params),
|
||||
axios.post<DetailResponse>(API_URL.escrowDetail(), params),
|
||||
);
|
||||
};
|
||||
|
||||
export const useEscroDetailMutation = (options?: UseMutationOptions<DetailResponse, CBDCAxiosError, EscroDetailParams>) => {
|
||||
const mutation = useMutation<DetailResponse, CBDCAxiosError, EscroDetailParams>({
|
||||
export const useEscrowDetailMutation = (options?: UseMutationOptions<DetailResponse, CBDCAxiosError, EscrowDetailParams>) => {
|
||||
const mutation = useMutation<DetailResponse, CBDCAxiosError, EscrowDetailParams>({
|
||||
...options,
|
||||
mutationFn: (params: EscroDetailParams) => escroDetail(params),
|
||||
mutationFn: (params: EscrowDetailParams) => escrowDetail(params),
|
||||
});
|
||||
|
||||
return {
|
||||
29
src/entities/transaction/api/use-escrow-list-mutation.ts
Normal file
29
src/entities/transaction/api/use-escrow-list-mutation.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL } from '@/shared/api/urls';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
EscrowListParams,
|
||||
EscrowListResponse
|
||||
} from '../model/types';
|
||||
import {
|
||||
useMutation,
|
||||
UseMutationOptions
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
export const escrowList = (params: EscrowListParams) => {
|
||||
return resultify(
|
||||
axios.post<EscrowListResponse>(API_URL.escrowList(), params),
|
||||
);
|
||||
};
|
||||
|
||||
export const useEscrowListMutation = (options?: UseMutationOptions<EscrowListResponse, CBDCAxiosError, EscrowListParams>) => {
|
||||
const mutation = useMutation<EscrowListResponse, CBDCAxiosError, EscrowListParams>({
|
||||
...options,
|
||||
mutationFn: (params: EscrowListParams) => escrowList(params),
|
||||
});
|
||||
|
||||
return {
|
||||
...mutation,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user