diff --git a/frontend/src/views/courses/CreateCourseView.vue b/frontend/src/views/courses/CreateCourseView.vue index 9994b531..f490dbff 100644 --- a/frontend/src/views/courses/CreateCourseView.vue +++ b/frontend/src/views/courses/CreateCourseView.vue @@ -13,7 +13,7 @@ import { useMessagesStore } from '@/store/messages.store.ts'; /* Composable injections */ const { t } = useI18n(); -const { addSuccessMessage } = useMessagesStore(); +const { addSuccessMessage, addErrorMessage } = useMessagesStore(); const { push } = useRouter(); const { faculties, getFaculties } = useFaculty(); const { createCourse } = useCourses(); @@ -28,11 +28,11 @@ const loading = ref(true); */ async function saveCourse(course: Course): Promise { try { - await createCourse(course); + await createCourse(course, false); addSuccessMessage(t('toasts.messages.success'), t('toasts.messages.courses.create.success', [course.name])); await push({ name: 'dashboard' }); } catch (error: any) { - // TODO error message + addErrorMessage(t('toasts.messages.error'), t('toasts.messages.courses.create.error', [course.name])); } } diff --git a/frontend/src/views/projects/CreateProjectView.vue b/frontend/src/views/projects/CreateProjectView.vue index 0815cd51..162789b4 100644 --- a/frontend/src/views/projects/CreateProjectView.vue +++ b/frontend/src/views/projects/CreateProjectView.vue @@ -42,11 +42,11 @@ const loading = ref(true); async function saveProject(newProject: Project, numberOfGroups: number): Promise { try { if (course.value !== null) { - await createProject(newProject, course.value.id, numberOfGroups); + await createProject(newProject, course.value.id, numberOfGroups, false); if (project.value !== null) { - await setStructureChecks(newProject.structure_checks ?? [], project.value.id); - await setExtraChecks(newProject.extra_checks ?? [], project.value.id); + await setStructureChecks(newProject.structure_checks ?? [], project.value.id, false); + await setExtraChecks(newProject.extra_checks ?? [], project.value.id, false); addSuccessMessage( t('toasts.messages.success'), t('toasts.messages.projects.create.success', [project.value?.name]), @@ -60,7 +60,7 @@ async function saveProject(newProject: Project, numberOfGroups: number): Promise } } } catch (error: any) { - processError(error); + addErrorMessage(t('toasts.messages.error'), t('toasts.messages.projects.create.error', [project.value?.name])); } }