diff --git a/src/API/v1/member.js b/src/API/v1/member.js index 7765f1de..a2484843 100644 --- a/src/API/v1/member.js +++ b/src/API/v1/member.js @@ -2,6 +2,18 @@ import axios from 'axios'; const API_URL = process.env.REACT_APP_API_URL; +async function getAllMembers() { + const options = { + method: 'GET', + url: API_URL + '/v1/common/members', + }; + try { + const response = await axios(options); + return response.data; + } catch (error) { + return error.response.data; + } +} async function getMember({ token }) { const options = { method: 'GET', @@ -324,6 +336,7 @@ async function getCommonMembers() { } export default { + getAllMembers, getMember, getMembers, updateEmail, diff --git a/src/API/v1/post.js b/src/API/v1/post.js index 42e3d069..1871c158 100644 --- a/src/API/v1/post.js +++ b/src/API/v1/post.js @@ -26,7 +26,7 @@ async function create({ formData.append('isSecret', isSecret); formData.append('isTemp', isTemp); formData.append('password', password); - formData.append('file', files); + files.forEach((file) => formData.append('file', file)); formData.append('thumbnail', thumbnailFile); const config = { @@ -150,7 +150,7 @@ async function modify({ formData.append('isTemp', isTemp); formData.append('password', password); formData.append('file', files); - formData.append('thumbnailFile', thumbnailFile); + formData.append('thumbnail', thumbnailFile); const config = { headers: { diff --git a/src/API/v1/study.js b/src/API/v1/study.js new file mode 100644 index 00000000..06480acf --- /dev/null +++ b/src/API/v1/study.js @@ -0,0 +1,122 @@ +import axios from 'axios'; + +const API_URL = process.env.REACT_APP_API_URL; + +async function getYears({ token }) { + const options = { + method: 'GET', + url: API_URL + '/v1/study/years', + headers: { + Authorization: `${token}`, + }, + }; + try { + const response = await axios(options); + return response.data; + } catch (error) { + return error.response.data; + } +} +async function getStudies({ token, year, season }) { + const options = { + method: 'GET', + url: API_URL + '/v1/study/list', + headers: { + Authorization: token, + }, + params: { year: year, season: season }, + }; + try { + const response = await axios(options); + return response.data; + } catch (error) { + return error.response.data; + } +} +async function create({ + year, + season, + title, + information, + memberIdList, + gitLink, + noteLink, + etcLink, + thumbnailFile, + ipAddress, + token, +}) { + const formData = new FormData(); + formData.append('studyDto.title', title); + formData.append('studyDto.information', information); + formData.append('studyDto.year', year); + formData.append('studyDto.season', season); + formData.append('studyDto.ipAddress', ipAddress); + //formData.append('memberIdList', headMember); + formData.append('memberIdList[]', memberIdList); + formData.append('studyDto.gitLink', gitLink); + formData.append('studyDto.noteLink', noteLink); + formData.append('studyDto.etcLink', etcLink); + if (thumbnailFile) formData.append('thumbnail', thumbnailFile); + + const config = { + headers: { + 'content-type': 'multipart/form-data', + Authorization: `${token}`, + }, + }; + try { + const response = await axios.post(API_URL + '/v1/study', formData, config); + return response.data; + } catch (error) { + return error.response.data; + } +} +async function modify({ + studyId, + year, + season, + title, + information, + memberIdList, + gitLink, + noteLink, + etcLink, + thumbnailFile, + ipAddress, + token, +}) { + const formData = new FormData(); + formData.append('studyId', studyId); + formData.append('studyDto.title', title); + formData.append('studyDto.information', information); + formData.append('studyDto.year', year); + formData.append('studyDto.season', season); + formData.append('studyDto.ipAddress', ipAddress); + //formData.append('memberIdList', headMember); + formData.append('memberIdList[]', memberIdList); + formData.append('studyDto.gitLink', gitLink); + formData.append('studyDto.noteLink', noteLink); + formData.append('studyDto.etcLink', etcLink); + if (thumbnailFile) formData.append('thumbnail', thumbnailFile); + + const config = { + headers: { + 'content-type': 'multipart/form-data', + Authorization: `${token}`, + }, + }; + try { + const response = await axios.put(API_URL + '/v1/study', formData, config); + return response.data; + } catch (error) { + return error.response.data; + } +} + +export default { + getYears, + getStudies, + create, + modify, +}; diff --git a/src/assets/img/icons/github.png b/src/assets/img/icons/github.png new file mode 100644 index 00000000..9490ffc6 Binary files /dev/null and b/src/assets/img/icons/github.png differ diff --git a/src/assets/img/icons/notion.png b/src/assets/img/icons/notion.png new file mode 100644 index 00000000..e46272fa Binary files /dev/null and b/src/assets/img/icons/notion.png differ diff --git a/src/page/Board/BoardMain.jsx b/src/page/Board/BoardMain.jsx index 40b8eec9..2e2bad9d 100644 --- a/src/page/Board/BoardMain.jsx +++ b/src/page/Board/BoardMain.jsx @@ -18,17 +18,19 @@ const Board = () => { return ( <> -
-
- - +
+
+
+ + +
+
+
+
-
-
-
diff --git a/src/page/Board/BoardView.jsx b/src/page/Board/BoardView.jsx index 1cfdcb56..ba933793 100644 --- a/src/page/Board/BoardView.jsx +++ b/src/page/Board/BoardView.jsx @@ -63,51 +63,55 @@ const BoardView = (props) => {
) : ( - -
-
- - {board?.id && prevBoard.id !== board.id ? ( - - ) : ( - '' - )} - {board?.allowComment == 0 ? ( -
- 작성자가 댓글 작성을 허용하지 않은 게시글입니다. -
- ) : ( -
+
+
+ +
+
+ {board?.id && prevBoard.id !== board.id ? ( - ) : ( '' )} -
- )} + {board?.allowComment == 0 ? ( +
+ 작성자가 댓글 작성을 허용하지 않은 게시글입니다. +
+ ) : ( +
+ {board?.id && prevBoard.id !== board.id ? ( + + ) : ( + '' + )} +
+ )} - + +
+
+
+ +
-
- -
)} diff --git a/src/page/Board/BoardWrite.jsx b/src/page/Board/BoardWrite.jsx index 047a1f2f..5098cc68 100644 --- a/src/page/Board/BoardWrite.jsx +++ b/src/page/Board/BoardWrite.jsx @@ -10,11 +10,13 @@ const BoardWrite = () => { const redirectData = useLocation(); return ( -
-
- -
- +
+
+
+ +
+ +
diff --git a/src/page/Board/Components/Boards.jsx b/src/page/Board/Components/Boards.jsx index 6230a199..46e8695a 100644 --- a/src/page/Board/Components/Boards.jsx +++ b/src/page/Board/Components/Boards.jsx @@ -23,9 +23,9 @@ const setPageButton = (currentPage, page) => { const getStyleIcon = (item) => { if (item == styleList[0]) { - return ; + return ; } else { - return ; + return ; } }; @@ -209,7 +209,7 @@ const Boards = ({ categoryId, commentChangeFlag, state, changeMode }) => { }, [currentPage, viewStyle, commentChangeFlag]); //currentPage 값이 변경될 때마다 return ( -
+
{noticeBoardContent.length === 0 && boardContent.length === 0 ? (
@@ -502,9 +502,9 @@ const Boards = ({ categoryId, commentChangeFlag, state, changeMode }) => {
-
+
checkYear(e.target.value)} + defaultValue={currentYear} + className="max-w-lg inline-block w-[8em] mx-2 mb-2 shadow-sm focus:ring-mainYellow focus:border-mainYellow sm:max-w-xs sm:text-sm border-gray-300 rounded-md dark:bg-mainBlack dark:border-darkComponent" + /> + + {notNumber || year == '' || season == 0 ? ( +
+
+ ) : ( + '' + )} +
+ +
+
+
+
+
+
+
+ setTitle(e.target.value)} + /> + {title == '' ? ( +
+
+ 필수로 기입해야하는 내용입니다! +
+
+ ) : ( + '' + )} +
+
+
+
+
+
+
+
+ + {information == '' ? ( +
+
+ ) : ( + '' + )} + +
+