Showing
1 changed file
with
4 additions
and
19 deletions
| ... | @@ -17,24 +17,15 @@ function ContentModal({element}) { | ... | @@ -17,24 +17,15 @@ function ContentModal({element}) { |
| 17 | setOpen(false); | 17 | setOpen(false); |
| 18 | } | 18 | } |
| 19 | const [open, setOpen] = useState(false) | 19 | const [open, setOpen] = useState(false) |
| 20 | -<<<<<<< HEAD | ||
| 21 | const [BoardComment, setBoardComment] = useState('') | 20 | const [BoardComment, setBoardComment] = useState('') |
| 22 | -======= | ||
| 23 | - const [BoardComment, setBoardComment] = useState("") | ||
| 24 | ->>>>>>> a7a00ce3dcec95df5fd17594f215fe752568dfa5 | ||
| 25 | const onCommentHandler = (event) => { | 21 | const onCommentHandler = (event) => { |
| 26 | setBoardComment(event.currentTarget.value) | 22 | setBoardComment(event.currentTarget.value) |
| 27 | console.log(BoardComment) | 23 | console.log(BoardComment) |
| 28 | } | 24 | } |
| 29 | const onSubmitHandler = () => { | 25 | const onSubmitHandler = () => { |
| 30 | -<<<<<<< HEAD | ||
| 31 | - Axios.post(`/api/comment${element.id}`,{ | ||
| 32 | - content: BoardComment | ||
| 33 | -======= | ||
| 34 | Axios.post('/api/comment/write',{ | 26 | Axios.post('/api/comment/write',{ |
| 35 | postid: element.id, | 27 | postid: element.id, |
| 36 | comment: BoardComment | 28 | comment: BoardComment |
| 37 | ->>>>>>> a7a00ce3dcec95df5fd17594f215fe752568dfa5 | ||
| 38 | }) | 29 | }) |
| 39 | .then((res)=>{ | 30 | .then((res)=>{ |
| 40 | if(res.status === 200){ | 31 | if(res.status === 200){ |
| ... | @@ -64,25 +55,19 @@ function ContentModal({element}) { | ... | @@ -64,25 +55,19 @@ function ContentModal({element}) { |
| 64 | </Modal.Description> | 55 | </Modal.Description> |
| 65 | </Modal.Content> | 56 | </Modal.Content> |
| 66 | <Modal.Content> | 57 | <Modal.Content> |
| 67 | - {viewComment&&viewComment.map(elem =>{ | 58 | + {viewComment&&viewComment.map(elem =>{ |
| 68 | return <div className="ui segment"> | 59 | return <div className="ui segment"> |
| 69 | -<<<<<<< HEAD | ||
| 70 | - <h2>{elem.id}</h2> | ||
| 71 | -======= | ||
| 72 | <h2>{elem.userid}</h2> | 60 | <h2>{elem.userid}</h2> |
| 73 | ->>>>>>> a7a00ce3dcec95df5fd17594f215fe752568dfa5 | 61 | + <h4>{elem.comment}</h4> |
| 74 | - <h4>{elem.comment}</h4> | ||
| 75 | </div>} | 62 | </div>} |
| 76 | - )} | 63 | + )} |
| 77 | </Modal.Content> | 64 | </Modal.Content> |
| 78 | <Modal.Actions> | 65 | <Modal.Actions> |
| 79 | - <Comment> | 66 | + <Comment> |
| 80 | <Form reply> | 67 | <Form reply> |
| 81 | <Form.TextArea value={BoardComment} onChange={onCommentHandler}/> | 68 | <Form.TextArea value={BoardComment} onChange={onCommentHandler}/> |
| 82 | - <div onClick={handleClose}> | ||
| 83 | <Button content='댓글 남기기' onClick={onSubmitHandler} labelPosition='left' icon='edit' primary /> | 69 | <Button content='댓글 남기기' onClick={onSubmitHandler} labelPosition='left' icon='edit' primary /> |
| 84 | <Button onClick={handleClose} color='black'>닫기</Button> | 70 | <Button onClick={handleClose} color='black'>닫기</Button> |
| 85 | - </div> | ||
| 86 | </Form> | 71 | </Form> |
| 87 | </Comment> | 72 | </Comment> |
| 88 | </Modal.Actions> | 73 | </Modal.Actions> | ... | ... |
-
Please register or login to post a comment