Skip to content
Snippets Groups Projects
Commit c21bb4cd authored by Hangzhi Yu's avatar Hangzhi Yu
Browse files

Fix setting of cancellation status

parent d930c675
No related branches found
No related tags found
1 merge request!329Introduce substitution to do list
Pipeline #185446 failed
......@@ -74,13 +74,13 @@ import createOrPatchMixin from "aleksis.core/mixins/createOrPatchMixin.js";
mandatory
:disabled="loading"
class="justify-self-end"
@change="changeCancel"
>
<v-chip
filter
outlined
color="success"
:value="false"
@click="changeCancel"
>
{{ $t("chronos.substitutions.overview.cancel.not_cancelled") }}
</v-chip>
......@@ -89,7 +89,6 @@ import createOrPatchMixin from "aleksis.core/mixins/createOrPatchMixin.js";
outlined
color="error"
:value="true"
@click="changeCancel"
>
{{ $t("chronos.substitutions.overview.cancel.cancelled") }}
</v-chip>
......@@ -109,6 +108,7 @@ export default {
loading: false,
teachers: [],
cancelled: undefined,
ready: false,
};
},
props: {
......@@ -141,12 +141,14 @@ export default {
]);
},
changeCancel() {
this.createOrPatch([
{
id: this.substitution.id,
cancelled: this.cancelled,
},
]);
if (this.ready) {
this.createOrPatch([
{
id: this.substitution.id,
cancelled: this.cancelled,
},
]);
}
},
},
computed: {
......@@ -179,6 +181,7 @@ export default {
mounted() {
this.teachers = this.substitution.teachers.map((teacher) => teacher.id);
this.cancelled = this.substitution.cancelled;
this.ready = true;
},
};
</script>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment