diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..b58b603fea78041071d125a30db58d79b3d49217 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,5 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/.idea/client.iml b/.idea/client.iml new file mode 100644 index 0000000000000000000000000000000000000000..24643cc37449b4bde54411a80b8ed61258225e34 --- /dev/null +++ b/.idea/client.iml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module type="WEB_MODULE" version="4"> + <component name="NewModuleRootManager"> + <content url="file://$MODULE_DIR$"> + <excludeFolder url="file://$MODULE_DIR$/.tmp" /> + <excludeFolder url="file://$MODULE_DIR$/temp" /> + <excludeFolder url="file://$MODULE_DIR$/tmp" /> + </content> + <orderEntry type="inheritedJdk" /> + <orderEntry type="sourceFolder" forTests="false" /> + </component> +</module> \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000000000000000000000000000000000000..0742ebc3adff31ae2584d375adada6d0fdf83f93 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="ProjectModuleManager"> + <modules> + <module fileurl="file://$PROJECT_DIR$/.idea/client.iml" filepath="$PROJECT_DIR$/.idea/client.iml" /> + </modules> + </component> +</project> \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000000000000000000000000000000000000..35eb1ddfbbc029bcab630581847471d7f238ec53 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="VcsDirectoryMappings"> + <mapping directory="" vcs="Git" /> + </component> +</project> \ No newline at end of file diff --git a/src/components/recruit/vote.js b/src/components/recruit/vote.js index 1d0c8fba042416df40bf83fe23adc5309dd3f220..c6c6937e63917ae40b2edc7db4cf476787d5dd7a 100644 --- a/src/components/recruit/vote.js +++ b/src/components/recruit/vote.js @@ -87,6 +87,7 @@ function Vote({ isOpen, onClose, data }) { if (response.ok){ alert("투표되었습니다."); setCount((prev) => (prev + 1)); + setAddSchedule([]); }else{ alert("투표를 실패하였습니다."); } @@ -98,18 +99,18 @@ function Vote({ isOpen, onClose, data }) { const endVote = async ()=>{ try{ const response = await fetch(`/api/recruits/${data.id}/times/vote`,{ - method: 'POST', + method: 'PUT', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({"idList" : addSchedule}), }); - + const jsonData = await response.json(); if (response.ok){ alert("투표 마감 후 스케줄이 성공적으로 추가되었습니다."); window.location.reload(); }else{ - alert('스케줄이 중복된 모집원이 존재합니다.'); + alert('스케줄이 중복된 모집원이 존재합니다.\n'+jsonData); } } catch(error){ console.log('Error during fetch:', error);