From b2c91536bd44ca00aa4345d4aae897907663d4d4 Mon Sep 17 00:00:00 2001 From: abg3000 Date: Tue, 27 Aug 2024 01:15:01 +0900 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=EC=9D=B8=EC=82=AC=ED=95=98=EA=B8=B0?= =?UTF-8?q?=20=EC=88=98=EB=9D=BD=EC=9D=B4=EB=82=98=20=EA=B1=B0=EC=A0=88?= =?UTF-8?q?=EC=99=84=EB=A3=8C=20=ED=95=9C=20=EA=B2=BD=EC=9A=B0=20=EB=B2=84?= =?UTF-8?q?=ED=8A=BC=20=EB=AF=B8=EB=85=B8=EC=B6=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/apis/schema/Notification.schema.ts | 1 + .../containers/AlarmListContainer.tsx | 80 ++++++++++--------- 2 files changed, 42 insertions(+), 39 deletions(-) diff --git a/packages/web-domains/src/home/common/apis/schema/Notification.schema.ts b/packages/web-domains/src/home/common/apis/schema/Notification.schema.ts index 393e2db6..4e1147bb 100644 --- a/packages/web-domains/src/home/common/apis/schema/Notification.schema.ts +++ b/packages/web-domains/src/home/common/apis/schema/Notification.schema.ts @@ -18,6 +18,7 @@ export type AlarmEventType = { status: 'ACTIVE' | 'INACTIVE'; additionalData: { handWavingId: number; + status?: 'NOT_REQUESTED' | 'REQUESTED' | 'ACCEPTED' | 'REJECTED'; } | null; createdAt: number; }; diff --git a/packages/web-domains/src/home/features/notification/containers/AlarmListContainer.tsx b/packages/web-domains/src/home/features/notification/containers/AlarmListContainer.tsx index b98427dd..70f5664f 100644 --- a/packages/web-domains/src/home/features/notification/containers/AlarmListContainer.tsx +++ b/packages/web-domains/src/home/features/notification/containers/AlarmListContainer.tsx @@ -17,49 +17,51 @@ export const AlarmListContainer = () => { switch (notification.type) { case 'HAND_WAVING_REQUESTED': { const handWavingId = notification.additionalData?.handWavingId; - + const isRequested = notification.additionalData?.status === 'REQUESTED'; return ( - - - - } + css={{ marginRight: '8px' }} + > + 나도 인사 건네기 + + + + ), + })} /> ); } From c22d216df52cbe4fca5c63f64022ba5f34b2248e Mon Sep 17 00:00:00 2001 From: abg3000 Date: Tue, 27 Aug 2024 01:17:01 +0900 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=EC=9D=B8=EC=82=AC=ED=95=98=EA=B8=B0?= =?UTF-8?q?=20=EC=88=98=EB=9D=BD=EC=9D=B4=EB=82=98=20=EA=B1=B0=EC=A0=88=20?= =?UTF-8?q?=EB=B2=84=ED=8A=BC=20=EB=88=84=EB=A5=B8=ED=9B=84=20invalidate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../services/useAlarmListService.ts | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/packages/web-domains/src/home/features/notification/services/useAlarmListService.ts b/packages/web-domains/src/home/features/notification/services/useAlarmListService.ts index fdb93cd0..2a8685f5 100644 --- a/packages/web-domains/src/home/features/notification/services/useAlarmListService.ts +++ b/packages/web-domains/src/home/features/notification/services/useAlarmListService.ts @@ -1,10 +1,13 @@ +import { useQueryClient } from '@tanstack/react-query'; + import { useHandWavingIgonoreMutation } from '@/home/common/apis/mutations/useHandWavingIgnoreMutation'; import { useHandWavingResponseMutation } from '@/home/common/apis/mutations/useHandWavingResponseMutation'; -import { useGetEvents } from '@/home/common/apis/queries/useGetEvents'; +import { EVENTS_QUERY_KEY, useGetEvents } from '@/home/common/apis/queries/useGetEvents'; import { useGetMyInfo } from '@/home/common/apis/queries/useGetMyInfo'; import { useSetCurrentMeeting } from '@/home/common/hooks/useSetCurrentMeeting'; export const useAlarmListService = () => { + const queryClient = useQueryClient(); const { meetingId } = useSetCurrentMeeting(); const { data: myInfo } = useGetMyInfo({ @@ -19,9 +22,21 @@ export const useAlarmListService = () => { }, }); - const { mutate: ignoreHandWaving } = useHandWavingIgonoreMutation(); + const { mutate: ignoreHandWaving } = useHandWavingIgonoreMutation({ + options: { + onSuccess: () => { + queryClient.invalidateQueries({ queryKey: [EVENTS_QUERY_KEY] }); + }, + }, + }); - const { mutate: handWavingResponse } = useHandWavingResponseMutation(); + const { mutate: handWavingResponse } = useHandWavingResponseMutation({ + options: { + onSuccess: () => { + queryClient.invalidateQueries({ queryKey: [EVENTS_QUERY_KEY] }); + }, + }, + }); return { meetingId,