Skip to content
Snippets Groups Projects
Commit fa93d115 authored by permcu's avatar permcu
Browse files

Rename createAbsences mutation to createAbsencesForPersons

This avoids a name collision with Kolego.
parent e105ea56
No related branches found
No related tags found
1 merge request!356Add dialog for creation of long-term absences
......@@ -75,7 +75,7 @@ import CreateButton from "aleksis.core/components/generic/buttons/CreateButton.v
import CancelButton from "aleksis.core/components/generic/buttons/CancelButton.vue";
import SaveButton from "aleksis.core/components/generic/buttons/SaveButton.vue";
import loadingMixin from "aleksis.core/mixins/loadingMixin.js";
import { createAbsences } from "./absenceCreation.graphql";
import { createAbsencesForPersons } from "./absenceCreation.graphql";
export default {
name: "AbsenceCreationDialog",
......@@ -107,7 +107,7 @@ export default {
confirm() {
this.handleLoading(true);
this.$apollo.mutate( {
mutation: createAbsences,
mutation: createAbsencesForPersons,
variables: {
persons: this.persons.map((p) => p.id),
start: this.startDate,
......
......@@ -37,14 +37,14 @@ query lessonsForPersons(
}
# Use absencesInputType?
mutation createAbsences(
mutation createAbsencesForPersons(
$persons: [ID]!
$start: Date!
$end: Date!
$comment: String
$reason: ID!
) {
createAbsences(
createAbsencesForPersons(
persons: $persons
start: $start
end: $end
......
......@@ -20,7 +20,7 @@ from .documentation import (
)
from .absences import (
LessonsForPersonType,
AbsencesBatchCreateMutation,
AbsencesForPersonsCreateMutation,
)
class Query(graphene.ObjectType):
......@@ -175,4 +175,4 @@ class Query(graphene.ObjectType):
class Mutation(graphene.ObjectType):
create_or_update_documentations = DocumentationBatchCreateOrUpdateMutation.Field()
create_absences = AbsencesBatchCreateMutation.Field()
create_absences_for_persons = AbsencesForPersonsCreateMutation.Field()
......@@ -10,7 +10,7 @@ class LessonsForPersonType(graphene.ObjectType):
id = graphene.ID() # noqa
lessons = graphene.List(DocumentationType)
class AbsencesBatchCreateMutation(graphene.Mutation):
class AbsencesForPersonsCreateMutation(graphene.Mutation):
class Arguments:
persons = graphene.List(graphene.ID, required=True)
start = graphene.Date(required=True)
......@@ -78,4 +78,4 @@ class AbsencesBatchCreateMutation(graphene.Mutation):
)
# Return ok=True if everything went well.
return AbsencesBatchCreateMutation(ok=True)
return AbsencesForPersonsCreateMutation(ok=True)
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