From dbc604d84a1b61b761ff5a78c8ddb96b241aab04 Mon Sep 17 00:00:00 2001 From: nobohan Date: Fri, 18 Mar 2022 17:02:35 +0100 Subject: [PATCH] AccompanyingCourseWorkEdit: download existing documents --- CHANGELOG.md | 2 ++ .../public/vuejs/AccompanyingCourseWorkEdit/store.js | 6 ++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 13ae858ba..885af7493 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ and this project adheres to ## Unreleased + +* [person] AccompanyingCourseWorkEdit: fix deleting evaluation documents (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/546) * [person] AccompanyingCourseWorkEdit: download existing documents (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/512) * [person] AccompanyingCourseWorkEdit: replace document by a new one (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/511) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js index 2ea9b48e0..359e7afad 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js @@ -131,9 +131,9 @@ const store = createStore({ endDate: e.endDate !== null ? ISOToDatetime(e.endDate.datetime) : null, maxDate: e.maxDate !== null ? ISOToDatetime(e.maxDate.datetime) : null, warningInterval: e.warningInterval !== null ? intervalISOToDays(e.warningInterval) : null, - documents: e.documents.map((d, dindex) => { + documents: e.documents.map((d, docIndex) => { return Object.assign(d, { - key: index + key: docIndex }); }), }); @@ -214,11 +214,9 @@ const store = createStore({ }, removeDocument(state, {key, document}) { let evaluation = state.evaluationsPicked.find(e => e.key === key); - if (evaluation === undefined) { return; } - evaluation.documents = evaluation.documents.filter(d => d.key !== document.key); }, replaceDocument(state, payload) {