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

Refetch day on delete of item without oldId

parent a1ce195f
No related branches found
No related tags found
1 merge request!329Introduce substitution to do list
Pipeline #193191 failed
...@@ -256,7 +256,7 @@ export default { ...@@ -256,7 +256,7 @@ export default {
cached[index].id = cached[index].oldId; cached[index].id = cached[index].oldId;
cached[index].oldId = null; cached[index].oldId = null;
} else { } else {
this.$emit("delete"); this.$emit("delete", cached[index].datetimeStart);
} }
} }
return cached; return cached;
...@@ -317,7 +317,6 @@ export default { ...@@ -317,7 +317,6 @@ export default {
this.comment = null; this.comment = null;
this.cancelled = null; this.cancelled = null;
} else if (!this.substitution.id.startsWith("DUMMY")) { } else if (!this.substitution.id.startsWith("DUMMY")) {
// FIXME: this makes deleted substitutions disappear temporarily – which is easy to resolve in case they still have an oldId but probably requires a refetch of the respective day when existing substitutions that were fetched are deleted to regain the dummy ID.
this.delete([this.substitution]); this.delete([this.substitution]);
} }
}, },
......
...@@ -11,6 +11,8 @@ import { ...@@ -11,6 +11,8 @@ import {
gqlGroups, gqlGroups,
gqlTeachers, gqlTeachers,
} from "../amendLesson.graphql"; } from "../amendLesson.graphql";
import { DateTime } from "luxon";
</script> </script>
<template> <template>
...@@ -95,6 +97,7 @@ import { ...@@ -95,6 +97,7 @@ import {
:is-create="false" :is-create="false"
:gql-patch-mutation="gqlPatchMutation" :gql-patch-mutation="gqlPatchMutation"
:gql-delete-mutation="gqlDeleteMutation" :gql-delete-mutation="gqlDeleteMutation"
@delete="handleDelete"
/> />
</template> </template>
...@@ -155,6 +158,9 @@ export default { ...@@ -155,6 +158,9 @@ export default {
}); });
this.$refs.iterator.resetDate(); this.$refs.iterator.resetDate();
}, },
handleDelete(datetime) {
this.$refs.iterator.refetchDay(DateTime.fromISO(datetime).toISODate());
},
}, },
computed: { computed: {
gqlQueryArgs() { gqlQueryArgs() {
......
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