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

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