sort 관련 정리
This commit is contained in:
29
src/entities/alarm/api/use-app-alarm-consent-mutation.ts
Normal file
29
src/entities/alarm/api/use-app-alarm-consent-mutation.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL_ALARM } from '@/shared/api/api-url-alarm';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
AppAlarmConsentParams,
|
||||
AppAlarmConsentResponse
|
||||
} from '../model/types';
|
||||
import {
|
||||
useMutation,
|
||||
UseMutationOptions
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
export const appAlarmConsent = (params: AppAlarmConsentParams) => {
|
||||
return resultify(
|
||||
axios.post<AppAlarmConsentResponse>(API_URL_ALARM.appAlarmConsent(), params),
|
||||
);
|
||||
};
|
||||
|
||||
export const useAppAlarmConsentMutation = (options?: UseMutationOptions<AppAlarmConsentResponse, CBDCAxiosError, AppAlarmConsentParams>) => {
|
||||
const mutation = useMutation<AppAlarmConsentResponse, CBDCAxiosError, AppAlarmConsentParams>({
|
||||
...options,
|
||||
mutationFn: (params: AppAlarmConsentParams) => appAlarmConsent(params),
|
||||
});
|
||||
|
||||
return {
|
||||
...mutation,
|
||||
};
|
||||
};
|
||||
29
src/entities/alarm/api/use-app-alarm-find-mutation.ts
Normal file
29
src/entities/alarm/api/use-app-alarm-find-mutation.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL_ALARM } from '@/shared/api/api-url-alarm';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
AppAlarmFindParams,
|
||||
AppAlarmFindResponse
|
||||
} from '../model/types';
|
||||
import {
|
||||
useMutation,
|
||||
UseMutationOptions
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
export const appAlarmFind = (params: AppAlarmFindParams) => {
|
||||
return resultify(
|
||||
axios.post<AppAlarmFindResponse>(API_URL_ALARM.appAlarmFind(), params),
|
||||
);
|
||||
};
|
||||
|
||||
export const useAppAlarmFindMutation = (options?: UseMutationOptions<AppAlarmFindResponse, CBDCAxiosError, AppAlarmFindParams>) => {
|
||||
const mutation = useMutation<AppAlarmFindResponse, CBDCAxiosError, AppAlarmFindParams>({
|
||||
...options,
|
||||
mutationFn: (params: AppAlarmFindParams) => appAlarmFind(params),
|
||||
});
|
||||
|
||||
return {
|
||||
...mutation,
|
||||
};
|
||||
};
|
||||
29
src/entities/alarm/api/use-app-alarm-list-mutation.ts
Normal file
29
src/entities/alarm/api/use-app-alarm-list-mutation.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL_ALARM } from '@/shared/api/api-url-alarm';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
AppAlarmListParams,
|
||||
AppAlarmListResponse
|
||||
} from '../model/types';
|
||||
import {
|
||||
useMutation,
|
||||
UseMutationOptions
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
export const appAlarmList = (params: AppAlarmListParams) => {
|
||||
return resultify(
|
||||
axios.post<AppAlarmListResponse>(API_URL_ALARM.appAlarmList(), params),
|
||||
);
|
||||
};
|
||||
|
||||
export const useAppAlarmListMutation = (options?: UseMutationOptions<AppAlarmListResponse, CBDCAxiosError, AppAlarmListParams>) => {
|
||||
const mutation = useMutation<AppAlarmListResponse, CBDCAxiosError, AppAlarmListParams>({
|
||||
...options,
|
||||
mutationFn: (params: AppAlarmListParams) => appAlarmList(params),
|
||||
});
|
||||
|
||||
return {
|
||||
...mutation,
|
||||
};
|
||||
};
|
||||
29
src/entities/alarm/api/use-app-alarm-mark-mutation.ts
Normal file
29
src/entities/alarm/api/use-app-alarm-mark-mutation.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL_ALARM } from '@/shared/api/api-url-alarm';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
AppAlarmMarkParams,
|
||||
AppAlarmMarkResponse
|
||||
} from '../model/types';
|
||||
import {
|
||||
useMutation,
|
||||
UseMutationOptions
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
export const appAlarmMark = (params: AppAlarmMarkParams) => {
|
||||
return resultify(
|
||||
axios.post<AppAlarmMarkResponse>(API_URL_ALARM.appAlarmMark(), params),
|
||||
);
|
||||
};
|
||||
|
||||
export const useAppAlarmMarkMutation = (options?: UseMutationOptions<AppAlarmMarkResponse, CBDCAxiosError, AppAlarmMarkParams>) => {
|
||||
const mutation = useMutation<AppAlarmMarkResponse, CBDCAxiosError, AppAlarmMarkParams>({
|
||||
...options,
|
||||
mutationFn: (params: AppAlarmMarkParams) => appAlarmMark(params),
|
||||
});
|
||||
|
||||
return {
|
||||
...mutation,
|
||||
};
|
||||
};
|
||||
@@ -1,6 +1,61 @@
|
||||
import { DefaulResponsePagination, DefaultRequestPagination } from '@/entities/common/model/types';
|
||||
|
||||
export interface AlarmItemProps {
|
||||
title?: string,
|
||||
name?: string,
|
||||
category?: string,
|
||||
date?: string
|
||||
title?: string;
|
||||
name?: string;
|
||||
category?: string;
|
||||
date?: string;
|
||||
};
|
||||
|
||||
export interface AppAlarmMarkParams {
|
||||
appNotificationSequence: number;
|
||||
usrid: string;
|
||||
};
|
||||
|
||||
export interface AppAlarmMarkResponse {
|
||||
|
||||
};
|
||||
export enum MERCHANT_ADMIN_APP {
|
||||
MERCHANT_ADMIN_APP = 'MERCHANT_ADMIN_APP',
|
||||
};
|
||||
export interface AppAlarmListParams {
|
||||
usrid: string;
|
||||
appCl: MERCHANT_ADMIN_APP;
|
||||
appNotificationCategory: string;
|
||||
page: DefaultRequestPagination;
|
||||
};
|
||||
export interface AppAlarmListResponse extends DefaulResponsePagination {
|
||||
content: Array<AlarmListContent>;
|
||||
};
|
||||
export interface AlarmListContent {
|
||||
appNotificationSequence: number;
|
||||
usrid: string;
|
||||
appCl: MERCHANT_ADMIN_APP;
|
||||
appNotificationCategory: string;
|
||||
notificationReceivedDate: string;
|
||||
appNotificationTitle: string;
|
||||
appNotificationContent: string;
|
||||
appNotificationLink: string;
|
||||
};
|
||||
|
||||
export interface AppAlarmFindParams {
|
||||
usrid: string;
|
||||
appCl: MERCHANT_ADMIN_APP;
|
||||
};
|
||||
|
||||
export interface AlarmAgree {
|
||||
appNotificationSubCategory: string;
|
||||
appNotificationAllowed: boolean;
|
||||
};
|
||||
export interface AppAlarmFindResponse {
|
||||
alarmAgree: Array<AlarmAgree>;
|
||||
};
|
||||
export interface AppAlarmConsentParams {
|
||||
appCl: MERCHANT_ADMIN_APP;
|
||||
usrid: string;
|
||||
appNotificationSubCategory: string;
|
||||
appNotificationAllowed: boolean;
|
||||
};
|
||||
export interface AppAlarmConsentResponse {
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user