feat: add new pages for authentication (register, forgot password) and course browsing (discovery, course detail)

This commit is contained in:
supalerk-ar66 2026-02-11 15:11:38 +07:00
parent acff387a9b
commit d4f84667dc
4 changed files with 39 additions and 8 deletions

View file

@ -14,6 +14,7 @@ const route = useRoute()
// courseId URL params ( integer)
const courseId = computed(() => parseInt(route.params.id as string))
const { currentUser } = useAuth()
const $q = useQuasar()
const { fetchCourseById, enrollCourse, getLocalizedText } = useCourse()
// useAsyncData Server-side rendering (SSR)
@ -46,9 +47,14 @@ const handleEnroll = async () => {
course_id: String(targetId)
}
})
} else {
// error alert ( Toast notification)
alert(res.error || 'Failed to enroll')
// error Toast notification alert
$q.notify({
type: 'negative',
message: res.error || 'Failed to enroll',
position: 'top',
timeout: 3000,
actions: [{ icon: 'close', color: 'white' }]
})
}
isEnrolling.value = false