mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +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"
|
class="form-control form-control-sm"
|
||||||
type="string"
|
type="string"
|
||||||
:value=d.title
|
:value=d.title
|
||||||
:id=i
|
:id=d.id
|
||||||
@input="onInputDocumentTitle"/>
|
@input="onInputDocumentTitle"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -260,9 +260,9 @@ export default {
|
|||||||
return this.$store.dispatch('submit', callback).catch(e => { console.log(e); throw e; });
|
return this.$store.dispatch('submit', callback).catch(e => { console.log(e); throw e; });
|
||||||
},
|
},
|
||||||
onInputDocumentTitle(event) {
|
onInputDocumentTitle(event) {
|
||||||
const id = event.target.id;
|
const id = Number(event.target.id);
|
||||||
const title = event.target.value;
|
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) {
|
addDocument(storedObject) {
|
||||||
console.log(storedObject);
|
console.log(storedObject);
|
||||||
|
@ -295,18 +295,8 @@ const store = createStore({
|
|||||||
state.isPosting = st;
|
state.isPosting = st;
|
||||||
},
|
},
|
||||||
updateDocumentTitle(state, payload) {
|
updateDocumentTitle(state, payload) {
|
||||||
state.evaluationsPicked.forEach(
|
state.evaluationsPicked.find(e => e.key === payload.evaluationKey)
|
||||||
e => {
|
.documents.find(d => d.id === payload.id).title = payload.title;
|
||||||
console.log(e);
|
|
||||||
if (e.key === payload.evaluationKey) {
|
|
||||||
e.documents.forEach(
|
|
||||||
d => {
|
|
||||||
d.title = payload.title;
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user