mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-13 10:14:57 +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,
|
||||
);
|
||||
|
||||
// add document to chosen evaluation
|
||||
document.key = evaluationB.documents.length + 1;
|
||||
evaluationB.documents.splice(0, 0, document);
|
||||
if (evaluationB) {
|
||||
// add document to chosen evaluation if evaluation is part of the same social work
|
||||
document.key = evaluationB.documents.length + 1;
|
||||
evaluationB.documents.splice(0, 0, document);
|
||||
}
|
||||
|
||||
// remove document from original evaluation
|
||||
const indexToRemove = evaluationA.documents.findIndex(
|
||||
|
Reference in New Issue
Block a user