Skip to content

Commit

Permalink
refactor: 채팅방 Alert 전송 방식 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Heeeera committed May 17, 2024
1 parent e9e8c65 commit b1f92a2
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/pages/GatheringDetail/hooks/useGatheringEntrance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import { showErrorToast } from '@/utils/showToast';

export const useGatheringEntrance = (roomId: string) => {
const postGatheringEntranceApi = usePostGatheringEntranceApi();
const { sendMessage } = useSendChatMessage(parseInt(roomId, 10));
const { sendMessage } = useSendChatMessage({
gatheringId: parseInt(roomId, 10),
});

return async (onOpenModal: () => void) => {
const { data, isOk, isBadRequest } = await postGatheringEntranceApi(roomId);
Expand Down
4 changes: 3 additions & 1 deletion src/pages/GatheringDetail/hooks/useGatheringLeave.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import { showErrorToast } from '@/utils/showToast';

export const useGatheringLeave = (roomId: string) => {
const postGatheringLeaveApi = usePostGatheringLeaveApi();
const { sendMessage } = useSendChatMessage(parseInt(roomId, 10));
const { sendMessage } = useSendChatMessage({
gatheringId: parseInt(roomId, 10),
});

return async (onOpenModal: () => void) => {
const { data, isOk, isBadRequest } = await postGatheringLeaveApi(roomId);
Expand Down
4 changes: 3 additions & 1 deletion src/pages/GatheringDetail/hooks/useKickParticipant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import { showErrorToast } from '@/utils/showToast';

export const useKickParticipant = (gatheringId: number) => {
const postKickParticipantApi = useKickParticipantApi(gatheringId);
const { sendMessage } = useSendChatMessage(gatheringId);
const { sendMessage } = useSendChatMessage({
gatheringId,
});

return async (userId: number, onOpenModal: () => void) => {
const { data, isOk, isBadRequest } = await postKickParticipantApi(userId);
Expand Down
4 changes: 3 additions & 1 deletion src/pages/GatheringFix/GatheringFixForm/useGatheringFix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ type OnGatheringFix = () => void;

const useCreateGathering = (onCreate: OnGatheringFix, gatheringId: string) => {
const gatheringCreateApi = usePostGatheringFix();
const { sendMessage } = useSendChatMessage(parseInt(gatheringId, 10));
const { sendMessage } = useSendChatMessage({
gatheringId: parseInt(gatheringId, 10),
});

return async (request: GatheringFixRequest) => {
const { data, isBadRequest } = await gatheringCreateApi({
Expand Down
4 changes: 3 additions & 1 deletion src/pages/GatheringUnfix/hooks/useGatheringUnfix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import type { OnGatheringUnfix } from '../components/GatheringUnfixForm';

const useGatheringUnfix = (onUnfix: OnGatheringUnfix, gatheringId: string) => {
const gatheringUnfixApi = useDeleteGatheringUnfixApi(gatheringId);
const { sendMessage } = useSendChatMessage(parseInt(gatheringId, 10));
const { sendMessage } = useSendChatMessage({
gatheringId: parseInt(gatheringId, 10),
});

return async (reason: string) => {
const { data, isBadRequest } = await gatheringUnfixApi({
Expand Down

0 comments on commit b1f92a2

Please sign in to comment.