Delete a course functionality

This commit is contained in:
Rotimi Best
2023-09-10 07:24:06 +01:00
parent 7e74568e74
commit bd2f647ca1
9 changed files with 29 additions and 11 deletions
@@ -47,7 +47,7 @@
let openPopover = false;
let player = null;
let aiButtonClass =
'flex items-center px-5 py-2 border border-gray-300 hover:bg-gray-200 rounded-md w-full mb-2';
'flex items-center px-5 py-2 border border-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 rounded-md w-full mb-2';
const onChange =
(tab = 0) =>
@@ -10,6 +10,7 @@
import { settingsDialog } from './store';
import { course } from '$lib/components/Course/store';
import { updateCourse, deleteCourse } from '$lib/utils/services/courses';
import { currentOrgPath } from '$lib/utils/store/org';
let shouldDelete = false;
let avatar;
@@ -41,7 +42,7 @@
async function handleDelete() {
$settingsDialog.open = false;
await deleteCourse($course.id);
goto('/courses');
goto($currentOrgPath + '/courses');
}
// function setAvatar(logo) {