diff --git a/apps/dashboard/src/lib/components/Course/components/Settings/index.svelte b/apps/dashboard/src/lib/components/Course/components/Settings/index.svelte
index 53f8a13f..818e05d4 100644
--- a/apps/dashboard/src/lib/components/Course/components/Settings/index.svelte
+++ b/apps/dashboard/src/lib/components/Course/components/Settings/index.svelte
@@ -9,7 +9,7 @@
RadioButtonGroup,
RadioButton
} from 'carbon-components-svelte';
- import { Restart } from 'carbon-icons-svelte';
+ import { Restart, ArrowUpRight } from 'carbon-icons-svelte';
import { PUBLIC_SERVER_URL } from '$env/static/public';
import SectionTitle from '$lib/components/Org/SectionTitle.svelte';
@@ -130,45 +130,28 @@
}
isSaving = true;
try {
- const {
- course_title,
- course_description,
- type,
- logo,
- tabs,
- grading,
- allow_new_students,
- lesson_download,
- is_published
- } = $settings;
- await updateCourse($course.id, avatar, {
- title: course_title,
- description: course_description,
- type: type,
- logo: logo,
- is_published,
+ const updatedCourse = {
+ title: $settings.course_title,
+ description: $settings.course_description,
+ type: $settings.type,
+ logo: $settings.logo,
+ is_published: $settings.is_published,
metadata: {
...(isObject($course.metadata) ? $course.metadata : {}),
- lessonTabsOrder: tabs,
- grading: grading,
- lessonDownload: lesson_download,
- allowNewStudent: allow_new_students
+ lessonTabsOrder: $settings.tabs,
+ grading: $settings.grading,
+ lessonDownload: $settings.lesson_download,
+ allowNewStudent: $settings.allow_new_students
},
slug: $course.slug
- });
-
- $course.title = course_title;
- $course.description = course_description;
- $course.type = type;
- $course.logo = logo;
- $course.is_published = is_published;
- $course.metadata = {
- ...(isObject($course.metadata) ? $course.metadata : {}),
- lessonTabsOrder: tabs,
- grading: grading,
- lessonDownload: lesson_download,
- allowNewStudent: allow_new_students
};
+ await updateCourse($course.id, avatar, updatedCourse);
+
+ $course = {
+ ...$course,
+ ...updatedCourse
+ };
+
snackbar.success('snackbar.course_settings.success.saved');
} catch (error) {
snackbar.error();
@@ -198,6 +181,7 @@
};
$: setDefault($course);
+ $: courseLink = `${$currentOrgDomain}/course/${$course.slug}`;
- {$t('course.navItem.landing_page.powered_by')}ClassroomIO
+
+ {$t('course.navItem.landing_page.powered_by')} ClassroomIO
{/if}