From 54305f3ff7fdedcf0956c464580f9d9850de2f4f Mon Sep 17 00:00:00 2001 From: bsilkyn Date: Tue, 21 May 2024 16:38:06 +0200 Subject: [PATCH] chore: log errors when creating with custom message #407 --- frontend/src/composables/services/course.service.ts | 4 +++- frontend/src/composables/services/project.service.ts | 4 +++- frontend/src/composables/services/submission.service.ts | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/frontend/src/composables/services/course.service.ts b/frontend/src/composables/services/course.service.ts index 316945d7..74624bec 100644 --- a/frontend/src/composables/services/course.service.ts +++ b/frontend/src/composables/services/course.service.ts @@ -85,7 +85,9 @@ export function useCourses(): CoursesState { t('toasts.messages.success'), t('toasts.messages.courses.create.success', [course.value?.name]), ); - } catch {} + } catch (e) { + console.log(e); + } } async function updateCourse(courseData: Course): Promise { diff --git a/frontend/src/composables/services/project.service.ts b/frontend/src/composables/services/project.service.ts index 4fd3e0b0..3bd6e099 100644 --- a/frontend/src/composables/services/project.service.ts +++ b/frontend/src/composables/services/project.service.ts @@ -107,7 +107,9 @@ export function useProject(): ProjectState { t('toasts.messages.success'), t('toasts.messages.projects.create.success', [project.value?.name]), ); - } catch {} + } catch (e) { + console.log(e); + } } async function updateProject(projectData: Project): Promise { diff --git a/frontend/src/composables/services/submission.service.ts b/frontend/src/composables/services/submission.service.ts index c8b31c19..49bbb756 100644 --- a/frontend/src/composables/services/submission.service.ts +++ b/frontend/src/composables/services/submission.service.ts @@ -47,7 +47,9 @@ export function useSubmission(): SubmissionState { try { await create(endpoint, formData, submission, Submission.fromJSONCreate, 'multipart/form-data'); addSuccessMessage(t('toasts.messages.success'), t('toasts.messages.submissions.create.success')); - } catch {} + } catch (e) { + console.log(e); + } } async function deleteSubmission(id: string): Promise {