diff --git a/src/components/settings/createMeeting.js b/src/components/settings/createMeeting.js
new file mode 100644
index 0000000..32ba45a
--- /dev/null
+++ b/src/components/settings/createMeeting.js
@@ -0,0 +1,44 @@
+import { useState } from 'react';
+import axios from 'axios';
+import CategorySelect from '../categorySelect';
+
+export default function CreateMeeting({ setIsExist, setWantEdit }) {
+ const [meetingTitle, setMeetingTitle] = useState('');
+ const [category, setCategory] = useState('');
+ const [meetingDesc, setMeetingDesc] = useState('');
+ const onCreateMeeting = async () => {
+ var data = new FormData();
+ data.append('CategorySeq', category);
+ data.append('meetingTitle', meetingTitle);
+ data.append('meetingDesc', meetingDesc);
+ data.append('meetingCamType', 0);
+ data.append('meetingMicType', 0);
+ axios
+ .post(process.env.REACT_APP_SERVER_URL + '/meetings', data, {
+ headers: {
+ Authorization: `Bearer ${localStorage.getItem('accessToken')}`,
+ },
+ })
+ .then((response) => {
+ setIsExist(true);
+ setWantEdit(false);
+ });
+ };
+ return (
+
+
자유열람실 생성
+
생성된 자유열람실이 없습니다. 자유열람실을 생성해주세요.
+
카테고리 선택: {setCategory && }
+
+ 자유열람실 이름:{' '}
+ setMeetingTitle(e.target.value)} />{' '}
+
+
+ 자유열람실 설명:{' '}
+ setMeetingDesc(e.target.value)}>
+
+
+
+
+ );
+}
diff --git a/src/components/settings/editMeeting.js b/src/components/settings/editMeeting.js
new file mode 100644
index 0000000..cfcaedc
--- /dev/null
+++ b/src/components/settings/editMeeting.js
@@ -0,0 +1,82 @@
+import { useEffect, useState } from 'react';
+import CategorySelect from '../categorySelect';
+import axios from 'axios';
+
+export default function EditMeeting({ setWantEdit, setIsExist }) {
+ const [myMeeting, setMyMeeting] = useState();
+ const [meetingSeq, setMeetingSeq] = useState();
+ const [category, setCategory] = useState();
+ const [meetingTitle, setMeetingTitle] = useState();
+ const [meetingDesc, setMeetingDesc] = useState();
+
+ const getMyMeeting = async () => {
+ axios
+ .get(process.env.REACT_APP_SERVER_URL + '/users/meetings', {
+ headers: {
+ Authorization: `Bearer ${localStorage.getItem('accessToken')}`,
+ },
+ })
+ .then((response) => {
+ setMyMeeting(() => response.data.meetingInfo);
+ setMeetingSeq(() => response.data.meetingInfo.meetingSeq);
+ setCategory(() => response.data.meetingInfo.categoryseq);
+ setMeetingTitle(() => response.data.meetingInfo.meetingTitle);
+ setMeetingDesc(() => response.data.meetingInfo.meetingDesc);
+ });
+ };
+ useEffect(() => {
+ getMyMeeting();
+ }, []);
+ const onSaveChange = async () => {
+ var data = new FormData();
+ data.append('meetingSeq', meetingSeq);
+ data.append('categorySeq', category);
+ data.append('meetingTitle', meetingTitle);
+ data.append('meetingDesc', meetingDesc);
+ data.append('meetingCamType', 0);
+ data.append('meetingMicType', 0);
+ await axios
+ .patch(process.env.REACT_APP_SERVER_URL + `/users/meetings/${meetingSeq}`, data, {
+ headers: {
+ Authorization: `Bearer ${localStorage.getItem('accessToken')}`,
+ },
+ })
+ .then((response) => {
+ setWantEdit(() => false);
+ setIsExist(() => true);
+ });
+ };
+ const onDelete = async () => {
+ await axios
+ .delete(process.env.REACT_APP_SERVER_URL + `/users/meetings/${meetingSeq}`, {
+ headers: {
+ Authorization: `Bearer ${localStorage.getItem('accessToken')}`,
+ },
+ })
+ .then((response) => {
+ setWantEdit(() => false);
+ setIsExist(() => false);
+ });
+ };
+ return (
+
+
미팅룸 수정
+ {myMeeting && (
+
+
+ 자유열람실 카테고리:
+
+
+ 자유열람실 이름:{' '}
+ setMeetingTitle(e.target.value)}>
+
+
+ 미팅룸 설명:
+
+ )}
+
+
+
+ );
+}
diff --git a/src/components/settings/readMeeting.js b/src/components/settings/readMeeting.js
new file mode 100644
index 0000000..84f8663
--- /dev/null
+++ b/src/components/settings/readMeeting.js
@@ -0,0 +1,38 @@
+import { useEffect, useState } from 'react';
+import axios from 'axios';
+
+export default function ReadMeeting({ setWantEdit }) {
+ const [myMeeting, setMyMeeting] = useState();
+ const toEdit = () => {
+ setWantEdit(() => true);
+ };
+ const getMyMeeting = async () => {
+ axios
+ .get(process.env.REACT_APP_SERVER_URL + '/users/meetings', {
+ headers: {
+ Authorization: `Bearer ${localStorage.getItem('accessToken')}`,
+ },
+ })
+ .then((response) => {
+ console.log(response);
+ setMyMeeting(() => response.data.meetingInfo);
+ });
+ };
+ useEffect(() => {
+ getMyMeeting();
+ }, []);
+ return (
+
+
미팅룸 조회
+
+ {myMeeting && (
+
+
자유열람실 이름: {myMeeting.meetingTitle}
+
자유열람실 카테고리: {myMeeting.category.categoryName}
+
현재 이용 중인 유저: {myMeeting.meetingHeadcount} 명
+
미팅룸 설명: {myMeeting.meetingDesc}
+
+ )}
+
+ );
+}
diff --git a/src/pages/SettingsMeeting.js b/src/pages/SettingsMeeting.js
index 26b4363..b0e96e5 100644
--- a/src/pages/SettingsMeeting.js
+++ b/src/pages/SettingsMeeting.js
@@ -1,10 +1,49 @@
+import axios from 'axios';
+import { useState, useEffect } from 'react';
+
+import ReadMeeting from '../components/settings/readMeeting';
+import EditMeeting from '../components/settings/editMeeting';
+import CreateMeeting from '../components/settings/createMeeting';
+
export default function SettingsMeeting() {
+ const [isExist, setIsExist] = useState(false);
+ const [wantEdit, setWantEdit] = useState(false);
+
+ const checkExist = async () => {
+ axios
+ .get(process.env.REACT_APP_SERVER_URL + '/users/meetings', {
+ headers: {
+ Authorization: `Bearer ${localStorage.getItem('accessToken')}`,
+ },
+ })
+ .then((response) => {
+ if (response.data.statusCode === 200) {
+ setIsExist(() => true);
+ } else {
+ setIsExist(() => false);
+ }
+ });
+ };
+ useEffect(() => {
+ checkExist();
+ }, []);
return (
내 자유열람실 관리
내 자유열람실을 관리할 수 있습니다
+ {isExist ? (
+
+ {wantEdit ? (
+
+ ) : (
+
+ )}
+
+ ) : (
+
+ )}
);
}
diff --git a/src/pages/SettingsMeetingFavorite.js b/src/pages/SettingsMeetingFavorite.js
index 3b7e790..9f0db4d 100644
--- a/src/pages/SettingsMeetingFavorite.js
+++ b/src/pages/SettingsMeetingFavorite.js
@@ -197,8 +197,9 @@ export default function SettingsMeetingFavorite() {
{selectedMeeting && (
+ {console.log(selectedMeeting)}
카테고리: {selectedMeeting.category.categoryName}
- 호스트 이름: {hostname}
+ 호스트 이름: {selectedMeeting.hostNickname}
현재 인원: {selectedMeeting.meetingHeadcount} / 12