Skip to content
Snippets Groups Projects
Commit a29a17d9 authored by Julian's avatar Julian
Browse files

Send tardinesses to frontend

parent 11b4d2c9
No related branches found
No related tags found
1 merge request!362Resolve "Add personal note management dialog in course book"
Pipeline #190641 failed
......@@ -46,6 +46,10 @@ mutation touchDocumentation($documentationId: ID!) {
id
note
}
noteWithTardiness {
id
tardiness
}
isOptimistic
}
}
......
......@@ -90,6 +90,10 @@ query documentationsForCoursebook(
id
note
}
noteWithTardiness {
id
tardiness
}
isOptimistic
}
topic
......
......@@ -5,6 +5,7 @@ query personalNotes($orderBy: [String], $filters: JSONString) {
extraMark {
id
}
tardiness
canEdit
canDelete
}
......@@ -18,6 +19,7 @@ mutation createPersonalNotes($input: [BatchCreatePersonalNoteInput]!) {
extraMark {
id
}
tardiness
canEdit
canDelete
}
......@@ -38,6 +40,7 @@ mutation updatePersonalNotes($input: [BatchPatchPersonalNoteInput]!) {
extraMark {
id
}
tardiness
canEdit
canDelete
}
......
......@@ -31,6 +31,7 @@ class ParticipationStatusType(
notes_with_extra_mark = graphene.List(PersonalNoteType)
notes_with_note = graphene.List(PersonalNoteType)
note_with_tardiness = graphene.Field(PersonalNoteType(), required=False)
@staticmethod
def resolve_notes_with_extra_mark(root: ParticipationStatus, info, **kwargs):
......@@ -45,9 +46,21 @@ class ParticipationStatusType(
return NewPersonalNote.objects.filter(
person=root.person,
documentation=root.related_documentation,
extra_mark__isnull=True,
note__isnull=False,
)
@staticmethod
def resolve_note_with_tardiness(root: ParticipationStatus, info, **kwargs):
notes = NewPersonalNote.objects.filter(
person=root.person,
documentation=root.related_documentation,
tardiness__isnull=False,
)
if len(notes):
return notes.first()
return None
class ParticipationStatusBatchPatchMutation(BaseBatchPatchMutation):
class Meta:
......
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