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 ...@@ -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 CancelButton from "aleksis.core/components/generic/buttons/CancelButton.vue";
import SaveButton from "aleksis.core/components/generic/buttons/SaveButton.vue"; import SaveButton from "aleksis.core/components/generic/buttons/SaveButton.vue";
import loadingMixin from "aleksis.core/mixins/loadingMixin.js"; import loadingMixin from "aleksis.core/mixins/loadingMixin.js";
import { createAbsences } from "./absenceCreation.graphql"; import { createAbsencesForPersons } from "./absenceCreation.graphql";
export default { export default {
name: "AbsenceCreationDialog", name: "AbsenceCreationDialog",
...@@ -107,7 +107,7 @@ export default { ...@@ -107,7 +107,7 @@ export default {
confirm() { confirm() {
this.handleLoading(true); this.handleLoading(true);
this.$apollo.mutate( { this.$apollo.mutate( {
mutation: createAbsences, mutation: createAbsencesForPersons,
variables: { variables: {
persons: this.persons.map((p) => p.id), persons: this.persons.map((p) => p.id),
start: this.startDate, start: this.startDate,
......
...@@ -37,14 +37,14 @@ query lessonsForPersons( ...@@ -37,14 +37,14 @@ query lessonsForPersons(
} }
# Use absencesInputType? # Use absencesInputType?
mutation createAbsences( mutation createAbsencesForPersons(
$persons: [ID]! $persons: [ID]!
$start: Date! $start: Date!
$end: Date! $end: Date!
$comment: String $comment: String
$reason: ID! $reason: ID!
) { ) {
createAbsences( createAbsencesForPersons(
persons: $persons persons: $persons
start: $start start: $start
end: $end end: $end
......
...@@ -20,7 +20,7 @@ from .documentation import ( ...@@ -20,7 +20,7 @@ from .documentation import (
) )
from .absences import ( from .absences import (
LessonsForPersonType, LessonsForPersonType,
AbsencesBatchCreateMutation, AbsencesForPersonsCreateMutation,
) )
class Query(graphene.ObjectType): class Query(graphene.ObjectType):
...@@ -175,4 +175,4 @@ class Query(graphene.ObjectType): ...@@ -175,4 +175,4 @@ class Query(graphene.ObjectType):
class Mutation(graphene.ObjectType): class Mutation(graphene.ObjectType):
create_or_update_documentations = DocumentationBatchCreateOrUpdateMutation.Field() create_or_update_documentations = DocumentationBatchCreateOrUpdateMutation.Field()
create_absences = AbsencesBatchCreateMutation.Field() create_absences_for_persons = AbsencesForPersonsCreateMutation.Field()
...@@ -10,7 +10,7 @@ class LessonsForPersonType(graphene.ObjectType): ...@@ -10,7 +10,7 @@ class LessonsForPersonType(graphene.ObjectType):
id = graphene.ID() # noqa id = graphene.ID() # noqa
lessons = graphene.List(DocumentationType) lessons = graphene.List(DocumentationType)
class AbsencesBatchCreateMutation(graphene.Mutation): class AbsencesForPersonsCreateMutation(graphene.Mutation):
class Arguments: class Arguments:
persons = graphene.List(graphene.ID, required=True) persons = graphene.List(graphene.ID, required=True)
start = graphene.Date(required=True) start = graphene.Date(required=True)
...@@ -78,4 +78,4 @@ class AbsencesBatchCreateMutation(graphene.Mutation): ...@@ -78,4 +78,4 @@ class AbsencesBatchCreateMutation(graphene.Mutation):
) )
# Return ok=True if everything went well. # 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