Skip to content

Commit

Permalink
fix: chat category data 잘못 보내주는 문제 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
nim-od committed Aug 16, 2024
1 parent 5fd156a commit 06b2738
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/user/src/hooks/socket/useChatSocket.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -26,8 +27,8 @@ export default function useChatSocket() {
(content: string) => {
console.assert(user !== null, '로그인 되지 않은 사용자가 메세지 전송을 시도했습니다.');

const { id: sender, type: team } = user as NonNullable<User>;
const chatMessage = { sender, team, content };
const { id: sender, type } = user as NonNullable<User>;
const chatMessage = { sender, team: categoryToSocketCategory[type as Category], content };

socketClient.sendMessages({
destination: CHAT_SOCKET_ENDPOINTS.PUBLISH,
Expand Down

0 comments on commit 06b2738

Please sign in to comment.