Skip to content

Commit

Permalink
fix : 일지 작성하기 버그 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
JongHyun authored and JongHyun committed Aug 5, 2024
1 parent 4da0d16 commit f1c7f8d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/diaryWritePage/components/DiaryWrite.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function DiaryWrite() {
setThumbnailModal(true);
};
useEffect(() => {
console.log("formData updated:", formData, csrfToken);
console.log("formData updated:", formData, csrfToken, goalId);
}, [formData]);

return (
Expand Down
9 changes: 4 additions & 5 deletions src/diaryWritePage/components/ThumbnailModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import styled from "styled-components";
import CloseRoundedIcon from "@mui/icons-material/CloseRounded";
import AddRoundedIcon from "@mui/icons-material/AddRounded";
import createDiary from "../../apis/createDiary";
function ThumbnailModal({ setThumbnailModal, setEditedModal, formData, diaryDetail, csrfToken }) {
function ThumbnailModal({ setThumbnailModal, setPostedModal, formData, goalId, csrfToken }) {
// 이미지 설정//
const fileInputRef = useRef(null);
const [previewUrl, setPreviewUrl] = useState(null); // 미리보기창에 들어갈 이미지 url
Expand All @@ -18,8 +18,7 @@ function ThumbnailModal({ setThumbnailModal, setEditedModal, formData, diaryDeta
};
const handleNextStep = async () => {
//
setThumbnailModal(false);
// setEditedModal(true);
// setPostedModal(true);
// ^^^^^^ 나중에 이 부분 지우기

// *** 이 함수 안에서 수정된 일지를 백엔드로 submit할 필요 있음 (내용 + 대표사진) *** //
Expand All @@ -38,9 +37,9 @@ function ThumbnailModal({ setThumbnailModal, setEditedModal, formData, diaryDeta
}
// TODO: 다이어리 수정하는 api 파일 생성하기 !!!!!! creatDiary말고 나중에
// 백엔드에서 일지 수정 api 생성하면 만들고 이 부분도 고치기.
await createDiary(formDataToSend, csrfToken, diaryDetail);
await createDiary(formDataToSend, csrfToken, goalId);
setThumbnailModal(false);
setEditedModal(true);
setPostedModal(true);
} catch (error) {
console.error("일지 생성 실패", error);
}
Expand Down

0 comments on commit f1c7f8d

Please sign in to comment.