mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
AccCourseWorkEdit: fix setting title on documents
This commit is contained in:
parent
15487cd84c
commit
289d79e011
@ -76,7 +76,7 @@
|
||||
class="form-control form-control-sm"
|
||||
type="string"
|
||||
:value=d.title
|
||||
:id=i
|
||||
:id=d.id
|
||||
@input="onInputDocumentTitle"/>
|
||||
</div>
|
||||
</div>
|
||||
@ -260,9 +260,9 @@ export default {
|
||||
return this.$store.dispatch('submit', callback).catch(e => { console.log(e); throw e; });
|
||||
},
|
||||
onInputDocumentTitle(event) {
|
||||
const id = event.target.id;
|
||||
const id = Number(event.target.id);
|
||||
const title = event.target.value;
|
||||
this.$store.commit('updateDocumentTitle', {key: id, evaluationKey: this.evaluation.key, title: title});
|
||||
this.$store.commit('updateDocumentTitle', {id: id, evaluationKey: this.evaluation.key, title: title});
|
||||
},
|
||||
addDocument(storedObject) {
|
||||
console.log(storedObject);
|
||||
|
@ -295,18 +295,8 @@ const store = createStore({
|
||||
state.isPosting = st;
|
||||
},
|
||||
updateDocumentTitle(state, payload) {
|
||||
state.evaluationsPicked.forEach(
|
||||
e => {
|
||||
console.log(e);
|
||||
if (e.key === payload.evaluationKey) {
|
||||
e.documents.forEach(
|
||||
d => {
|
||||
d.title = payload.title;
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
)
|
||||
state.evaluationsPicked.find(e => e.key === payload.evaluationKey)
|
||||
.documents.find(d => d.id === payload.id).title = payload.title;
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
|
Loading…
x
Reference in New Issue
Block a user