From 06b27387942c65f8bbb18ffeb5a3bd13469e6ad6 Mon Sep 17 00:00:00 2001 From: nimod7890 Date: Fri, 16 Aug 2024 14:37:30 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20chat=20category=20data=20=EC=9E=98?= =?UTF-8?q?=EB=AA=BB=20=EB=B3=B4=EB=82=B4=EC=A3=BC=EB=8A=94=20=EB=AC=B8?= =?UTF-8?q?=EC=A0=9C=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/user/src/hooks/socket/useChatSocket.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/user/src/hooks/socket/useChatSocket.ts b/packages/user/src/hooks/socket/useChatSocket.ts index c05660ab..4123a7a6 100644 --- a/packages/user/src/hooks/socket/useChatSocket.ts +++ b/packages/user/src/hooks/socket/useChatSocket.ts @@ -1,5 +1,6 @@ import { ChatProps } from '@softeer/common/components'; -import { CHAT_SOCKET_ENDPOINTS } from '@softeer/common/constants'; +import { categoryToSocketCategory, CHAT_SOCKET_ENDPOINTS } from '@softeer/common/constants'; +import { Category } from '@softeer/common/types'; import { SocketSubscribeCallbackType } from '@softeer/common/utils'; import { useCallback, useState } from 'react'; import useAuth from 'src/hooks/useAuth.tsx'; @@ -26,8 +27,8 @@ export default function useChatSocket() { (content: string) => { console.assert(user !== null, '로그인 되지 않은 사용자가 메세지 전송을 시도했습니다.'); - const { id: sender, type: team } = user as NonNullable; - const chatMessage = { sender, team, content }; + const { id: sender, type } = user as NonNullable; + const chatMessage = { sender, team: categoryToSocketCategory[type as Category], content }; socketClient.sendMessages({ destination: CHAT_SOCKET_ENDPOINTS.PUBLISH,