From 18ababbca9d4189b571ee1905bed10b5c813fac6 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 21 Aug 2025 16:14:17 +0200 Subject: [PATCH] Handle error when moving document between evaluations and display toast upon success --- .../vuejs/AccompanyingCourseWorkEdit/store.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js index cd09163e9..d19954045 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js @@ -655,13 +655,19 @@ const store = createStore({ { commit }, { evaluationInitial, evaluationDest, document }, ) { - await moveDocumentToEvaluation(document.id, evaluationDest.id); + try { + const response = await moveDocumentToEvaluation(document.id, evaluationDest.id); + commit("moveDocumentToEvaluation", { + evaluationInitial, + evaluationDest, + document, + }); - commit("moveDocumentToEvaluation", { - evaluationInitial, - evaluationDest, - document, - }); + return response; + } catch (error) { + console.error("Failed to move document:", error); + throw error; + } }, removeDocument({ commit }, payload) { commit("removeDocument", payload);