edit: response.message
This commit is contained in:
parent
d7f824f353
commit
7de5457170
21 changed files with 227 additions and 127 deletions
|
|
@ -430,7 +430,7 @@ const saveLesson = async () => {
|
|||
navigateTo(`/instructor/courses/${courseId}/structure`);
|
||||
} catch (error) {
|
||||
console.error('Failed to save lesson:', error);
|
||||
$q.notify({ type: 'negative', message: 'ไม่สามารถบันทึกได้', position: 'top' });
|
||||
$q.notify({ type: 'negative', message: (error as any).data?.error?.message || (error as any).data?.message || 'ไม่สามารถบันทึกได้', position: 'top' });
|
||||
} finally {
|
||||
saving.value = false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,6 +62,20 @@
|
|||
autogrow
|
||||
rows="3"
|
||||
/>
|
||||
<q-card-section class="flex justify-end gap-2">
|
||||
<q-btn
|
||||
flat
|
||||
label="ยกเลิก"
|
||||
@click="navigateTo(`/instructor/courses/${courseId}/structure`)"
|
||||
/>
|
||||
<q-btn
|
||||
color="primary"
|
||||
label="บันทึก"
|
||||
icon="save"
|
||||
:loading="saving"
|
||||
@click="saveLesson"
|
||||
/>
|
||||
</q-card-section>
|
||||
</div>
|
||||
</q-card-section>
|
||||
|
||||
|
|
@ -182,20 +196,7 @@
|
|||
|
||||
<!-- Actions -->
|
||||
<q-separator />
|
||||
<q-card-section class="flex justify-end gap-2">
|
||||
<q-btn
|
||||
flat
|
||||
label="ยกเลิก"
|
||||
@click="navigateTo(`/instructor/courses/${courseId}/structure`)"
|
||||
/>
|
||||
<q-btn
|
||||
color="primary"
|
||||
label="บันทึก"
|
||||
icon="save"
|
||||
:loading="saving"
|
||||
@click="saveLesson"
|
||||
/>
|
||||
</q-card-section>
|
||||
|
||||
</q-card>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -58,7 +58,8 @@
|
|||
|
||||
<!-- Status Badges -->
|
||||
<div class="flex gap-2">
|
||||
<q-badge v-if="course.is_free" color="purple">เผยแพร่</q-badge>
|
||||
<q-badge v-if="course.is_free" color="purple">ฟรี</q-badge>
|
||||
<q-badge v-else color="purple">เสียเงิน</q-badge>
|
||||
<q-badge :color="getStatusColor(course.status)">
|
||||
{{ getStatusLabel(course.status) }}
|
||||
</q-badge>
|
||||
|
|
|
|||
|
|
@ -204,6 +204,7 @@
|
|||
:rules="[val => !!val || 'กรุณากรอกชื่อบทเรียน']"
|
||||
lazy-rules="ondemand"
|
||||
hide-bottom-space
|
||||
class="mb-4"
|
||||
/>
|
||||
<q-input
|
||||
v-model="lessonForm.title.en"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue