mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-14 02:34:58 +00:00
Handle store state updates when moving documents
- Add null check to prevent error when evaluation is not part of this social work
This commit is contained in:
@@ -326,9 +326,11 @@ const store = createStore({
|
|||||||
(e) => e.id === evaluationDest.id,
|
(e) => e.id === evaluationDest.id,
|
||||||
);
|
);
|
||||||
|
|
||||||
// add document to chosen evaluation
|
if (evaluationB) {
|
||||||
document.key = evaluationB.documents.length + 1;
|
// add document to chosen evaluation if evaluation is part of the same social work
|
||||||
evaluationB.documents.splice(0, 0, document);
|
document.key = evaluationB.documents.length + 1;
|
||||||
|
evaluationB.documents.splice(0, 0, document);
|
||||||
|
}
|
||||||
|
|
||||||
// remove document from original evaluation
|
// remove document from original evaluation
|
||||||
const indexToRemove = evaluationA.documents.findIndex(
|
const indexToRemove = evaluationA.documents.findIndex(
|
||||||
|
Reference in New Issue
Block a user