edit: response.message

This commit is contained in:
Missez 2026-02-02 09:31:22 +07:00
parent d7f824f353
commit 7de5457170
21 changed files with 227 additions and 127 deletions

View file

@ -100,9 +100,9 @@
<div class="flex justify-between items-start mb-2">
<h3 class="font-semibold text-gray-900 line-clamp-2">{{ course.title.th }}</h3>
<q-badge :color="getStatusColor(course.status)" class="ml-2">
{{ getStatusLabel(course.status) }}
</q-badge>
</div>
{{ getStatusLabel(course.status) }}
</q-badge>
</div>
<p class="text-sm text-gray-500 line-clamp-2 mb-3">
{{ course.description.th }}
@ -277,18 +277,18 @@ const confirmDelete = (course: CourseResponse) => {
persistent: true
}).onOk(async () => {
try {
await instructorService.deleteCourse(course.id);
const response = await instructorService.deleteCourse(course.id);
$q.notify({
type: 'positive',
message: 'ลบหลักสูตรสำเร็จ',
message: response.message || 'ลบหลักสูตรสำเร็จ',
position: 'top'
});
// Refresh list
fetchCourses();
} catch (error) {
} catch (error: any) {
$q.notify({
type: 'negative',
message: 'ไม่สามารถลบหลักสูตรได้',
message: error.data?.message || 'ไม่สามารถลบหลักสูตรได้',
position: 'top'
});
}