AccompanyingCourseWorkEdit: download existing documents

This commit is contained in:
nobohan 2022-03-18 17:02:35 +01:00
parent 82052f5d70
commit dbc604d84a
2 changed files with 4 additions and 4 deletions

View File

@ -11,6 +11,8 @@ and this project adheres to
## Unreleased
<!-- write down unreleased development here -->
* [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)

View File

@ -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) {