feat: Add useCourse composable for course data management and a new discovery page.
This commit is contained in:
parent
327f6ec7b5
commit
8f38f795e6
2 changed files with 13 additions and 6 deletions
|
|
@ -86,12 +86,6 @@ const handleEnroll = async (id: number) => {
|
|||
if (res.success) {
|
||||
// Navigate to my-courses where the success modal will be shown
|
||||
return navigateTo('/dashboard/my-courses?enrolled=true');
|
||||
} else if (res.code === 409) {
|
||||
// Already enrolled, maybe redirect to course learning page or my-courses?
|
||||
// For now, let's redirect to my-courses as well, maybe with a different param or just same.
|
||||
// User requirement didn't specify distinct behavior for 409 in UI terms,
|
||||
// but 'Already enrolled' implies they should go see it.
|
||||
return navigateTo('/dashboard/my-courses');
|
||||
} else {
|
||||
alert(res.error || 'Failed to enroll');
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue