css 수정 홈 api payment api
This commit is contained in:
29
src/entities/home/api/use-home-banner-list-mutation.ts
Normal file
29
src/entities/home/api/use-home-banner-list-mutation.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL_HOME } from '@/shared/api/api-url-home';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
HomeBannerListParams,
|
||||
HomeBannerListResponse
|
||||
} from '../model/types';
|
||||
import {
|
||||
useMutation,
|
||||
UseMutationOptions
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
export const homeBannerList = (params: HomeBannerListParams) => {
|
||||
return resultify(
|
||||
axios.post<HomeBannerListResponse>(API_URL_HOME.homeBannerList(), params),
|
||||
);
|
||||
};
|
||||
|
||||
export const useHomeBannerListMutation = (options?: UseMutationOptions<HomeBannerListResponse, CBDCAxiosError, HomeBannerListParams>) => {
|
||||
const mutation = useMutation<HomeBannerListResponse, CBDCAxiosError, HomeBannerListParams>({
|
||||
...options,
|
||||
mutationFn: (params: HomeBannerListParams) => homeBannerList(params),
|
||||
});
|
||||
|
||||
return {
|
||||
...mutation,
|
||||
};
|
||||
};
|
||||
29
src/entities/home/api/use-home-groups-mutation.ts
Normal file
29
src/entities/home/api/use-home-groups-mutation.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL_HOME } from '@/shared/api/api-url-home';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
HomeGroupsParams,
|
||||
HomeGroupsResponse
|
||||
} from '../model/types';
|
||||
import {
|
||||
useMutation,
|
||||
UseMutationOptions
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
export const homeGroups = (params: HomeGroupsParams) => {
|
||||
return resultify(
|
||||
axios.post<HomeGroupsResponse>(API_URL_HOME.homeGroups(), params),
|
||||
);
|
||||
};
|
||||
|
||||
export const useHomeGroupsMutation = (options?: UseMutationOptions<HomeGroupsResponse, CBDCAxiosError, HomeGroupsParams>) => {
|
||||
const mutation = useMutation<HomeGroupsResponse, CBDCAxiosError, HomeGroupsParams>({
|
||||
...options,
|
||||
mutationFn: (params: HomeGroupsParams) => homeGroups(params),
|
||||
});
|
||||
|
||||
return {
|
||||
...mutation,
|
||||
};
|
||||
};
|
||||
29
src/entities/home/api/use-home-month-mutation.ts
Normal file
29
src/entities/home/api/use-home-month-mutation.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL_HOME } from '@/shared/api/api-url-home';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
HomeMonthParams,
|
||||
HomeMonthResponse
|
||||
} from '../model/types';
|
||||
import {
|
||||
useMutation,
|
||||
UseMutationOptions
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
export const homeMonth = (params: HomeMonthParams) => {
|
||||
return resultify(
|
||||
axios.post<HomeMonthResponse>(API_URL_HOME.homeMonth(), params),
|
||||
);
|
||||
};
|
||||
|
||||
export const useHomeMonthwMutation = (options?: UseMutationOptions<HomeMonthResponse, CBDCAxiosError, HomeMonthParams>) => {
|
||||
const mutation = useMutation<HomeMonthResponse, CBDCAxiosError, HomeMonthParams>({
|
||||
...options,
|
||||
mutationFn: (params: HomeMonthParams) => homeMonth(params),
|
||||
});
|
||||
|
||||
return {
|
||||
...mutation,
|
||||
};
|
||||
};
|
||||
29
src/entities/home/api/use-home-notice-list-mutation.ts
Normal file
29
src/entities/home/api/use-home-notice-list-mutation.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL_HOME } from '@/shared/api/api-url-home';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
HomeNoticeListParams,
|
||||
HomeNoticeListResponse
|
||||
} from '../model/types';
|
||||
import {
|
||||
useMutation,
|
||||
UseMutationOptions
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
export const homeNoticeList = (params: HomeNoticeListParams) => {
|
||||
return resultify(
|
||||
axios.post<HomeNoticeListResponse>(API_URL_HOME.homeBannerList(), params),
|
||||
);
|
||||
};
|
||||
|
||||
export const useHomeBannerListMutation = (options?: UseMutationOptions<HomeNoticeListResponse, CBDCAxiosError, HomeNoticeListParams>) => {
|
||||
const mutation = useMutation<HomeNoticeListResponse, CBDCAxiosError, HomeNoticeListParams>({
|
||||
...options,
|
||||
mutationFn: (params: HomeNoticeListParams) => homeNoticeList(params),
|
||||
});
|
||||
|
||||
return {
|
||||
...mutation,
|
||||
};
|
||||
};
|
||||
29
src/entities/home/api/use-home-overview-mutation.ts
Normal file
29
src/entities/home/api/use-home-overview-mutation.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL_HOME } from '@/shared/api/api-url-home';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
HomeOverviewParams,
|
||||
HomeOverviewResponse
|
||||
} from '../model/types';
|
||||
import {
|
||||
useMutation,
|
||||
UseMutationOptions
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
export const homeOverview = (params: HomeOverviewParams) => {
|
||||
return resultify(
|
||||
axios.post<HomeOverviewResponse>(API_URL_HOME.homeOverview(), params),
|
||||
);
|
||||
};
|
||||
|
||||
export const useHomeOverviewMutation = (options?: UseMutationOptions<HomeOverviewResponse, CBDCAxiosError, HomeOverviewParams>) => {
|
||||
const mutation = useMutation<HomeOverviewResponse, CBDCAxiosError, HomeOverviewParams>({
|
||||
...options,
|
||||
mutationFn: (params: HomeOverviewParams) => homeOverview(params),
|
||||
});
|
||||
|
||||
return {
|
||||
...mutation,
|
||||
};
|
||||
};
|
||||
29
src/entities/home/api/use-home-today-mutation.ts
Normal file
29
src/entities/home/api/use-home-today-mutation.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL_HOME } from '@/shared/api/api-url-home';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
HomeTodayParams,
|
||||
HomeTodayResponse
|
||||
} from '../model/types';
|
||||
import {
|
||||
useMutation,
|
||||
UseMutationOptions
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
export const homeToday = (params: HomeTodayParams) => {
|
||||
return resultify(
|
||||
axios.post<HomeTodayResponse>(API_URL_HOME.homeToday(), params),
|
||||
);
|
||||
};
|
||||
|
||||
export const useHomeTodayMutation = (options?: UseMutationOptions<HomeTodayResponse, CBDCAxiosError, HomeTodayParams>) => {
|
||||
const mutation = useMutation<HomeTodayResponse, CBDCAxiosError, HomeTodayParams>({
|
||||
...options,
|
||||
mutationFn: (params: HomeTodayParams) => homeToday(params),
|
||||
});
|
||||
|
||||
return {
|
||||
...mutation,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user