diff --git a/src/components/calendar/calendar.js b/src/components/calendar/calendar.js index d8b1913fbc4d2d1910289144aae994d4c154fd9a..2025dfd439fce30d1b319445c06e50405515341b 100644 --- a/src/components/calendar/calendar.js +++ b/src/components/calendar/calendar.js @@ -215,7 +215,6 @@ const MySchedulerApp = ({ setCount }) => { .then(response => response.json()) .then(data => { const backendDataArray = data.schedules; - console.log("ghkrdls",data.schedules); const processedDataArray = []; for (const backendData of backendDataArray) { const startDate = new Date(backendData.date); diff --git a/src/components/channel/createChannel.js b/src/components/channel/createChannel.js index 6fee6709ce713920328ed90a0074f9f5e3c258ad..e0f6e1d3b7a34f965f902e71f008710447e80950 100644 --- a/src/components/channel/createChannel.js +++ b/src/components/channel/createChannel.js @@ -41,10 +41,8 @@ function CreateChannel({ isOpen, onClose }){ console.log(JSON.stringify(formData)); if (response.ok) { - // 성공적으로 모집글이 생성됨 alert('채널이 성공적으로 생성되었습니다.'); } else { - // 오류 처리 alert('채널 생성에 실패하였습니다.'); } diff --git a/src/components/channel/myChannelModal.js b/src/components/channel/myChannelModal.js index fd17db3683366eb6acaca8fe36ea1abae7394400..4db4cc1879d7985b3f6b758a40e5da3ab91e965f 100644 --- a/src/components/channel/myChannelModal.js +++ b/src/components/channel/myChannelModal.js @@ -14,16 +14,10 @@ const MyChannelModal=({isOpen, onClose})=>{ openCreateModal(); onClose(); } - useEffect={ - - } - return( <div> <div className={`${modalStyles.channelModal} ${isOpen ? modalStyles.open : ''}`}> - - <div className={modalStyles.channelModal_overlay}> <div className={modalStyles.chModal}> <p>채널이 존재하지 않습니다.</p> diff --git a/src/components/search.js b/src/components/search.js index 5e21966ff9c0d354624872f4ef3736ddb2d26ca8..c19403c50a901afee56e27550ce13b3564c9ad5a 100644 --- a/src/components/search.js +++ b/src/components/search.js @@ -4,8 +4,7 @@ import searchStyles from './search.module.css'; import CreateRecruit from './recruit/createRecruit'; import MyChannelModal from './channel/myChannelModal'; import ExistingChannel from './channel/existingChannel'; -export const SearchContext = createContext(); -function Search({ currentPage, onUrlGenerated, onFirstQueryString, onSecondQueryString }){ +function Search({ currentPage, onUrlGenerated, onFirstQueryString, onSecondQueryString, fetchCount, setfetchCount }){ const [isModalOpen, setIsModalOpen] = useState(false); const [ischannelOpen, setchannelModalOpen] = useState(false); const [searchTerm, setSearchTerm] = useState(''); @@ -13,12 +12,7 @@ function Search({ currentPage, onUrlGenerated, onFirstQueryString, onSecondQuery const [sortType, setSortType] = useState(''); const [haveChannel, sethaveChannel]=useState(true); const [myChannelData, setmyChannelData]=useState(''); - const [fetchCount, setfetchCount] = useState(0); - const searchValue = { - fetchCount, - setfetchCount, - }; - + const navigate = useNavigate(); const openModal = () => { @@ -54,9 +48,12 @@ function Search({ currentPage, onUrlGenerated, onFirstQueryString, onSecondQuery } else{ sethaveChannel(false); + openchannelModal(); } } catch (error) { console.error('Error fetching weekly schedules:', error); + sethaveChannel(false); + openchannelModal(); } }; diff --git a/src/pages/mypage.js b/src/pages/mypage.js index be856384330ce3f7ec753a6ee8d2e792883f3672..0e3b8bc20fe084e817ea0af8567c2796accd09f0 100644 --- a/src/pages/mypage.js +++ b/src/pages/mypage.js @@ -45,7 +45,7 @@ const Mypage=()=>{ const closeMywriting=()=>{ setIsmyWriting(false); } - const handleProfileUpdate = async ({ image, nickname, statusMessage }) => { + const handleProfileUpdate = async ({ imagePath, nickname, statusMessage }) => { try { if(nickname === ''){ alert('닉네임을 입력해주세요.'); @@ -53,6 +53,8 @@ const Mypage=()=>{ } else if(statusMessage===''){ alert('상태 메시지를 입력해주세요.'); return; + }else if(imagePath===''){ + alert('이미지를 등록해주세요.'); } const data={ "nickname":nickname, @@ -61,7 +63,7 @@ const Mypage=()=>{ const formData = new FormData(); formData.append('data', JSON.stringify(data)); - formData.append('image', image) + formData.append('image', imagePath) const response = await fetch('api/mypage', { method: 'PUT', diff --git a/src/pages/mypage.module.css b/src/pages/mypage.module.css index 505dcaa5a5043d0c089cec382e9da904471534b2..a28a17a0602dbce1592dd9ac90271e3b0d243b9d 100644 --- a/src/pages/mypage.module.css +++ b/src/pages/mypage.module.css @@ -60,7 +60,8 @@ .nickname{ font-size:30px; color:black; - margin-top:-28%; + margin-top:-30%; + width:170px; } .message{ margin-top:5%;