mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-28 17:44:58 +00:00
Handle error when moving document between evaluations and display toast upon success
This commit is contained in:
@@ -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);
|
||||||
|
Reference in New Issue
Block a user