Skip to content

Commit

Permalink
[KAN-119] feat: 모임 만들고 나서 주최자가 자동으로 참여하는 기능 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
BeMatthewsong committed Oct 11, 2024
1 parent f4dfb25 commit 70037de
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/app/components/Modal/MakeGatheringModal.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
'use client';

import { useRouter } from 'next/navigation';
import postGatherings from '@/app/api/actions/gatherings/postGatherings';
import postGatheringToJoin from '@/app/api/actions/gatherings/postGatheringToJoin';

import { LOCATION_OPTIONS, MIN_PARTICIPANTS } from '@/constants/common';
import objectCheckFalseValue from '@/utils/objectCheckFalseValue';
import objectExtractTrueValue from '@/utils/objectExtractTrueValue';

import { useRouter } from 'next/navigation';
import { FormEvent, useState } from 'react';
import toast from 'react-hot-toast';

import Button from '../Button/Button';
import BoxSelectGroup from './MakeGatheringModal/BoxSelectGroup';
import CalendarSelect from './MakeGatheringModal/CalendarSelect';
import ImageUploader from './MakeGatheringModal/ImageUploader';
import NameInput from './MakeGatheringModal/NameInput';
import PlaceDropdown from './MakeGatheringModal/PlaceDropdown';
import RecruitmentNumber from './MakeGatheringModal/RecruitmentNumber';
import SelectTimeChip from './MakeGatheringModal/SelectTimeChip';
import ModalFrame from './ModalFrame';
import ModalHeader from './ModalHeader';
import NameInput from './MakeGatheringModal/NameInput';
import objectExtractTrueValue from '@/utils/objectExtractTrueValue';
import objectCheckFalseValue from '@/utils/objectCheckFalseValue';

interface MakeGatheringModalProps {
onClose: () => void;
Expand Down Expand Up @@ -79,7 +83,11 @@ const MakeGatheringModal = ({ onClose }: MakeGatheringModalProps) => {
}

onClose();

await postGatheringToJoin(data.id);

router.push(`/gatherings/${data.id}`);

toast.success(message);
};

Expand Down

0 comments on commit 70037de

Please sign in to comment.