홈 알림 unread 뱃지 처리
This commit is contained in:
@@ -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 { NiceAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
AppAlarmUnreadCountParams,
|
||||
AppAlarmUnreadCountResponse
|
||||
} from '../model/types';
|
||||
import {
|
||||
useMutation,
|
||||
UseMutationOptions
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
export const appAlarmUnreadCount = (params: AppAlarmUnreadCountParams) => {
|
||||
return resultify(
|
||||
axios.post<AppAlarmUnreadCountResponse>(API_URL_ALARM.appAlarmUnreadCount(), params),
|
||||
);
|
||||
};
|
||||
|
||||
export const useAppAlarmUnreadCountMutation = (options?: UseMutationOptions<AppAlarmUnreadCountResponse, NiceAxiosError, AppAlarmUnreadCountParams>) => {
|
||||
const mutation = useMutation<AppAlarmUnreadCountResponse, NiceAxiosError, AppAlarmUnreadCountParams>({
|
||||
...options,
|
||||
mutationFn: (params: AppAlarmUnreadCountParams) => appAlarmUnreadCount(params),
|
||||
});
|
||||
|
||||
return {
|
||||
...mutation,
|
||||
};
|
||||
};
|
||||
@@ -53,4 +53,11 @@ export interface AppAlarmConsentParams {
|
||||
};
|
||||
export interface AppAlarmConsentResponse {
|
||||
|
||||
};
|
||||
export interface AppAlarmUnreadCountParams {
|
||||
usrid: string;
|
||||
appCl: MERCHANT_ADMIN_APP;
|
||||
};
|
||||
export interface AppAlarmUnreadCountResponse {
|
||||
unreadCount: number;
|
||||
};
|
||||
Reference in New Issue
Block a user