Handle error when moving document between evaluations and display toast upon success

This commit is contained in:
2025-08-21 16:14:17 +02:00
parent f6179cd3a3
commit 18ababbca9

View File

@@ -655,13 +655,19 @@ const store = createStore({
{ commit }, { commit },
{ evaluationInitial, evaluationDest, document }, { 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", { return response;
evaluationInitial, } catch (error) {
evaluationDest, console.error("Failed to move document:", error);
document, throw error;
}); }
}, },
removeDocument({ commit }, payload) { removeDocument({ commit }, payload) {
commit("removeDocument", payload); commit("removeDocument", payload);