Skip to content

Commit

Permalink
Fix : 보고서 제출시 학생 ID가 number라서 체크박스 선택되지 않는 버그 String으로 바꿈으로써 수정(#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
ohinhyuk committed Sep 18, 2023
1 parent 52795c3 commit 6f5397e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions histudy-front/src/components/Post/PostMember.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default function PostMember({ control, setValue, getValues }) {
let { value, checked } = event.target;

// value = value.slice(value.length - 8, value.length);

console.log(",dsad", value);
if (checked) {
setValue("participants", [...getValues("participants"), value]);
} else {
Expand All @@ -39,8 +39,8 @@ export default function PostMember({ control, setValue, getValues }) {
render={({ field }) => (
<Checkbox
{...field}
value={tm.id}
checked={field.value.includes(tm.id)}
value={tm.id + ""}
checked={field.value.includes(tm.id + "")}
onChange={handleCheckboxChange}
/>
)}
Expand Down
2 changes: 1 addition & 1 deletion histudy-front/src/pages/Post/Post.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default function Post({ children }) {
defaultValues: {
title: state ? state.title : "",
content: state ? state.content : "",
participants: state ? state.participants.map((p) => p.id) : [],
participants: state ? state.participants.map((p) => p.id + "") : [],
totalMinutes: state ? state.totalMinutes : "",
images: state ? [...state.images.map((image) => image.url)] : [],
courses: state ? state.courses.map((c) => c.id.toString()) : [],
Expand Down

0 comments on commit 6f5397e

Please sign in to comment.