

240814 권민수 학생 질문 업데이트 기능 추가
@31d67704d1a3d8c2c268bc46cb8977967fc8d633
--- client/views/layout/Side.vue
+++ client/views/layout/Side.vue
... | ... | @@ -26,7 +26,7 @@ |
26 | 26 |
<p class="title1 mb15">선생님께 질문 있어요~</p> |
27 | 27 |
|
28 | 28 |
<div class="memo mb15"><textarea name="" id="" placeholder="궁금한 것을 적어보세요." v-model="studentInfo.studentQuestion"></textarea></div> |
29 |
- <div class="flex justify-end"><button>질문하기</button></div> |
|
29 |
+ <div class="flex justify-end"><button @click="updateQuestion">질문하기</button></div> |
|
30 | 30 |
</div> |
31 | 31 |
<!-- <div class="btn-wrap flex justify-between"> |
32 | 32 |
<button class="login-btn" @click="handleClick" > |
... | ... | @@ -73,6 +73,22 @@ |
73 | 73 |
}); |
74 | 74 |
}, |
75 | 75 |
|
76 |
+ // 질문 업데이트 메서드 |
|
77 |
+ updateQuestion() { |
|
78 |
+ axios.post('/studentInfo/updateQuestion.json', { |
|
79 |
+ userId: this.userId, |
|
80 |
+ studentQuestion: this.studentInfo.studentQuestion |
|
81 |
+ }) |
|
82 |
+ .then(response => { |
|
83 |
+ console.log('질문이 성공적으로 업데이트되었습니다.'); |
|
84 |
+ alert('질문이 성공적으로 업데이트되었습니다.'); |
|
85 |
+ }) |
|
86 |
+ .catch(error => { |
|
87 |
+ console.error('질문 업데이트 실패:', error); |
|
88 |
+ alert('질문 업데이트에 실패했습니다.'); |
|
89 |
+ }); |
|
90 |
+ }, |
|
91 |
+ |
|
76 | 92 |
handleClick() { |
77 | 93 |
this.toggleText(); |
78 | 94 |
this.goToPage('PreviewNote'); |
--- client/views/pages/main/PreviewNote.vue
+++ client/views/pages/main/PreviewNote.vue
... | ... | @@ -16,7 +16,7 @@ |
16 | 16 |
<p class="title">오답노트</p> |
17 | 17 |
</div> |
18 | 18 |
<div class="wrap" style="border-radius: 0;"> |
19 |
- |
|
19 |
+ㄴ |
|
20 | 20 |
<div class="table-wrap"> |
21 | 21 |
<table> |
22 | 22 |
<colgroup> |
... | ... | @@ -56,7 +56,7 @@ |
56 | 56 |
currentStdId: "1", // 임시 학생 아이디 |
57 | 57 |
currentUnitId: "1", // 임시 유닛 아이디 |
58 | 58 |
wrongAnswerNotes: [], // 오답 노트 목록 데이터 |
59 |
- unitData: {}, |
|
59 |
+ unitData: {}, // 단원 정보 데이터 |
|
60 | 60 |
} |
61 | 61 |
}, |
62 | 62 |
methods: { |
... | ... | @@ -67,6 +67,7 @@ |
67 | 67 |
console.log('링크될 문제 ID:', prblmId); |
68 | 68 |
}, |
69 | 69 |
|
70 |
+ // 단원 정보를 불러오는 API 호출 |
|
70 | 71 |
fetchUnitDetail() { |
71 | 72 |
axios.post('/unit/unitDetail.json', { |
72 | 73 |
unitId: this.currentUnitId |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?