diff --git a/src/notification/api/notification.ts b/src/notification/api/notification.ts index 1f8a967a..d3680901 100644 --- a/src/notification/api/notification.ts +++ b/src/notification/api/notification.ts @@ -1,6 +1,7 @@ import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; import client from '@/common/service/client'; import useToast from '@/common-ui/Toast/hooks/useToast'; +import qs from 'qs'; import dayjs from 'dayjs'; import 'dayjs/locale/ko'; dayjs.locale('ko'); @@ -115,27 +116,26 @@ export const usePATCHNotificationReadQuery = ({ }; interface DELETENotificationRequest { - notificationId: number; - token?: string; + notificationIds: string[]; + memberId: number; } const deleteNotificationAPI = async ({ - notificationId, - token, + memberId, + notificationIds, }: DELETENotificationRequest) => { const { data } = await client({ method: 'delete', - url: `/notifications/${notificationId}`, - params: { notificationId }, - data: {}, - headers: token ? { Authorization: `Bearer ${token}` } : {}, + url: `/members/${memberId}/notifications/selected`, + params: { notificationIds }, + paramsSerializer: (params) => + qs.stringify(params, { arrayFormat: 'repeat' }), }); return data; }; export interface DELETENotificationQueryRequest { memberId: number; - token?: string; } export const useDELETENotificationQuery = ({ memberId, diff --git a/src/pages/NotificationPage.tsx b/src/pages/NotificationPage.tsx index a65da5a0..b5fc11b9 100644 --- a/src/pages/NotificationPage.tsx +++ b/src/pages/NotificationPage.tsx @@ -48,7 +48,8 @@ const NotificationPage = () => { // NOTE : 임시로 하나씩 삭제 call if (mode === 'DELETE') { await mutateDeleteCategory({ - notificationId: Number(deleteCategoryList[0]), + memberId, + notificationIds: deleteCategoryList, }); } if (mode === 'DELETE_ALL') {