|
|
@@ -51,7 +51,7 @@ function insertBoard() {
|
|
|
formData.append('type', type);
|
|
|
axios.post('/api/v1/board', formData)
|
|
|
.then(res=>{
|
|
|
- alert('저장이 완료되었습니다.')
|
|
|
+ alert('저장이 완료되었습니다.');
|
|
|
adminChangeInner('admin-notice');
|
|
|
|
|
|
})
|
|
|
@@ -60,6 +60,37 @@ function insertBoard() {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+function commentBoard() {
|
|
|
+ const comment = document.getElementById('board_comment_content').value;
|
|
|
+ document.getElementById('saveBtn').style.display = 'inline-block';
|
|
|
+ document.getElementById('commentBtn').style.display = 'none';
|
|
|
+ document.getElementById('delBtn').style.display = 'none';
|
|
|
+ document.getElementById('board_comment_content').style.display = 'flex';
|
|
|
+ document.getElementById('comment_label').style.display = 'block';
|
|
|
+ document.getElementById('board_comment_content').focus();
|
|
|
+
|
|
|
+ if (comment.length > 1) {
|
|
|
+ document.getElementById('board_comment').style.display = 'none';
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+function saveComment() {
|
|
|
+ const id = document.getElementById('board_id').value;
|
|
|
+ const comment = document.getElementById('board_comment_content').value;
|
|
|
+ if (comment) {
|
|
|
+ axios.put('/api/v1/board/comment', {id, comment})
|
|
|
+ .then(res => {
|
|
|
+ alert('답변이 저장되었습니다.');
|
|
|
+ adminChangeInner('admin-advice');
|
|
|
+ })
|
|
|
+ .catch(error => {
|
|
|
+ console.log(error);
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
function nullCheck (data) {
|
|
|
return !data || !data.trim();
|
|
|
}
|