현금영수증 리스트
This commit is contained in:
29
src/entities/user/api/use-shortcut-detault-mutation.ts
Normal file
29
src/entities/user/api/use-shortcut-detault-mutation.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL_USER } from '@/shared/api/api-url-user';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
ShortcutDefaultParams,
|
||||
ShortcutDefaultResponse
|
||||
} from '../model/types';
|
||||
import {
|
||||
useMutation,
|
||||
UseMutationOptions
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
export const shortcutDefault = (params: ShortcutDefaultParams) => {
|
||||
return resultify(
|
||||
axios.post<ShortcutDefaultResponse>(API_URL_USER.shortcutDefault(), params),
|
||||
);
|
||||
};
|
||||
|
||||
export const useShortcutDefaultMutation = (options?: UseMutationOptions<ShortcutDefaultResponse, CBDCAxiosError, ShortcutDefaultParams>) => {
|
||||
const mutation = useMutation<ShortcutDefaultResponse, CBDCAxiosError, ShortcutDefaultParams>({
|
||||
...options,
|
||||
mutationFn: (params: ShortcutDefaultParams) => shortcutDefault(params),
|
||||
});
|
||||
|
||||
return {
|
||||
...mutation,
|
||||
};
|
||||
};
|
||||
29
src/entities/user/api/use-shortcut-save-mutation.ts
Normal file
29
src/entities/user/api/use-shortcut-save-mutation.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL_USER } from '@/shared/api/api-url-user';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
ShortcutSaveParams,
|
||||
ShortcutSaveResponse
|
||||
} from '../model/types';
|
||||
import {
|
||||
useMutation,
|
||||
UseMutationOptions
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
export const shortcutSave = (params: ShortcutSaveParams) => {
|
||||
return resultify(
|
||||
axios.post<ShortcutSaveResponse>(API_URL_USER.shortcutSave(), params),
|
||||
);
|
||||
};
|
||||
|
||||
export const useShortcutSaveMutation = (options?: UseMutationOptions<ShortcutSaveResponse, CBDCAxiosError, ShortcutSaveParams>) => {
|
||||
const mutation = useMutation<ShortcutSaveResponse, CBDCAxiosError, ShortcutSaveParams>({
|
||||
...options,
|
||||
mutationFn: (params: ShortcutSaveParams) => shortcutSave(params),
|
||||
});
|
||||
|
||||
return {
|
||||
...mutation,
|
||||
};
|
||||
};
|
||||
29
src/entities/user/api/use-shortcut-user-mutation.ts
Normal file
29
src/entities/user/api/use-shortcut-user-mutation.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL_USER } from '@/shared/api/api-url-user';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
ShortcutUserParams,
|
||||
ShortcutUserResponse
|
||||
} from '../model/types';
|
||||
import {
|
||||
useMutation,
|
||||
UseMutationOptions
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
export const shortcutUser = (params: ShortcutUserParams) => {
|
||||
return resultify(
|
||||
axios.post<ShortcutUserResponse>(API_URL_USER.shortcutUser(), params),
|
||||
);
|
||||
};
|
||||
|
||||
export const useShortcutUserMutation = (options?: UseMutationOptions<ShortcutUserResponse, CBDCAxiosError, ShortcutUserParams>) => {
|
||||
const mutation = useMutation<ShortcutUserResponse, CBDCAxiosError, ShortcutUserParams>({
|
||||
...options,
|
||||
mutationFn: (params: ShortcutUserParams) => shortcutUser(params),
|
||||
});
|
||||
|
||||
return {
|
||||
...mutation,
|
||||
};
|
||||
};
|
||||
@@ -29,10 +29,12 @@ export interface LoginResponse {
|
||||
};
|
||||
|
||||
export interface UserFavorite {
|
||||
title?: string;
|
||||
img?: string;
|
||||
path?: string;
|
||||
menuId?: string;
|
||||
seq?: number;
|
||||
menuId?: number;
|
||||
menuName?: string;
|
||||
menuNameEng?: string;
|
||||
iconFilePath?: string | null;
|
||||
programPath?: string;
|
||||
};
|
||||
export interface UserInfo extends LoginResponse {
|
||||
status: boolean;
|
||||
@@ -221,9 +223,40 @@ export interface AuthMethodItem {
|
||||
authMethodType: string;
|
||||
sequence: number;
|
||||
content: string;
|
||||
}
|
||||
};
|
||||
|
||||
export interface UserAuthMethodData {
|
||||
emails: Array<AuthMethodItem>;
|
||||
phones: Array<AuthMethodItem>;
|
||||
}
|
||||
};
|
||||
|
||||
export interface ShortcutDefaultParams {
|
||||
usrid: string;
|
||||
};
|
||||
export interface ShortcutDefaultResponse {
|
||||
shortcuts: Array<Shortcuts>;
|
||||
usingDefault: boolean;
|
||||
};
|
||||
export interface Shortcuts {
|
||||
seq: number;
|
||||
menuId: number;
|
||||
menuName: string;
|
||||
menuNameEng: string;
|
||||
iconFilePath: string;
|
||||
programPath: string;
|
||||
};
|
||||
export interface ShortcutSaveParams {
|
||||
usrid: string;
|
||||
isDefault: boolean;
|
||||
menuIds: Array<number | undefined>;
|
||||
};
|
||||
export interface ShortcutSaveResponse {
|
||||
|
||||
};
|
||||
export interface ShortcutUserParams {
|
||||
usrid: string;
|
||||
};
|
||||
export interface ShortcutUserResponse {
|
||||
shortcuts: Array<Shortcuts>;
|
||||
usingDefault: boolean;
|
||||
};
|
||||
Reference in New Issue
Block a user