현금영수증 수기 발행 완료
This commit is contained in:
@@ -1,29 +0,0 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL_USER } from '@/shared/api/api-url-user';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { NiceAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
BusinessPropertyByMidParams,
|
||||
BusinessPropertyByMidResponse
|
||||
} from '../model/types';
|
||||
import {
|
||||
useMutation,
|
||||
UseMutationOptions
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
export const businessPropertyByMid = (params: BusinessPropertyByMidParams) => {
|
||||
return resultify(
|
||||
axios.post<BusinessPropertyByMidResponse>(API_URL_USER.businessPropertyByMid(), params),
|
||||
);
|
||||
};
|
||||
|
||||
export const useBusinessPropertyByMidMutation = (options?: UseMutationOptions<BusinessPropertyByMidResponse, NiceAxiosError, BusinessPropertyByMidParams>) => {
|
||||
const mutation = useMutation<BusinessPropertyByMidResponse, NiceAxiosError, BusinessPropertyByMidParams>({
|
||||
...options,
|
||||
mutationFn: (params: BusinessPropertyByMidParams) => businessPropertyByMid(params),
|
||||
});
|
||||
|
||||
return {
|
||||
...mutation,
|
||||
};
|
||||
};
|
||||
29
src/entities/user/api/use-business-property-mutation.ts
Normal file
29
src/entities/user/api/use-business-property-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 { NiceAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
BusinessPropertyParams,
|
||||
BusinessPropertyResponse
|
||||
} from '../model/types';
|
||||
import {
|
||||
useMutation,
|
||||
UseMutationOptions
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
export const businessProperty = (params: BusinessPropertyParams) => {
|
||||
return resultify(
|
||||
axios.post<BusinessPropertyResponse>(API_URL_USER.businessProperty(), params),
|
||||
);
|
||||
};
|
||||
|
||||
export const useBusinessPropertyMutation = (options?: UseMutationOptions<BusinessPropertyResponse, NiceAxiosError, BusinessPropertyParams>) => {
|
||||
const mutation = useMutation<BusinessPropertyResponse, NiceAxiosError, BusinessPropertyParams>({
|
||||
...options,
|
||||
mutationFn: (params: BusinessPropertyParams) => businessProperty(params),
|
||||
});
|
||||
|
||||
return {
|
||||
...mutation,
|
||||
};
|
||||
};
|
||||
@@ -261,13 +261,13 @@ export interface ShortcutUserResponse {
|
||||
usingDefault: boolean;
|
||||
};
|
||||
|
||||
export interface BusinessPropertyByMidParams {
|
||||
export interface BusinessPropertyParams {
|
||||
mid: string;
|
||||
};
|
||||
export interface BusinessPropertyByMidResponse {
|
||||
export interface BusinessPropertyResponse {
|
||||
companyNumber: string;
|
||||
businessScaleTypeName: string;
|
||||
};
|
||||
export interface BusinessInfo extends BusinessPropertyByMidResponse {
|
||||
export interface BusinessInfo extends BusinessPropertyResponse {
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user