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

Port minitimetables to bundles

parent 0e7fc658
No related branches found
No related tags found
1 merge request!50Resolve "Implement bundled courses/lessons"
...@@ -73,10 +73,10 @@ export default defineComponent({ ...@@ -73,10 +73,10 @@ export default defineComponent({
); );
this.lessons?.forEach((lesson) => { this.lessons?.forEach((lesson) => {
const weekdayStart = lesson.slotStart.weekday; const weekdayStart = lesson.bundle[0].slotStart.weekday;
const weekdayEnd = lesson.slotEnd.weekday; const weekdayEnd = lesson.bundle[0].slotEnd.weekday;
const periodStart = lesson.slotStart.period; const periodStart = lesson.bundle[0].slotStart.period;
const periodEnd = lesson.slotEnd.period; const periodEnd = lesson.bundle[0].slotEnd.period;
// If lesson start and end is on the same day, just add it in between the periods // If lesson start and end is on the same day, just add it in between the periods
if (weekdayStart === weekdayEnd) { if (weekdayStart === weekdayEnd) {
......
...@@ -4,15 +4,18 @@ query lessonsTeacher($teacher: ID!, $timeGrid: ID!) { ...@@ -4,15 +4,18 @@ query lessonsTeacher($teacher: ID!, $timeGrid: ID!) {
timeGrid: $timeGrid timeGrid: $timeGrid
) { ) {
id id
slotStart { bundle {
id slotStart {
period id
weekday period
} weekday
slotEnd { }
id slotEnd {
period id
weekday period
weekday
}
recurrence
} }
subject { subject {
id id
...@@ -50,7 +53,6 @@ query lessonsTeacher($teacher: ID!, $timeGrid: ID!) { ...@@ -50,7 +53,6 @@ query lessonsTeacher($teacher: ID!, $timeGrid: ID!) {
shortName shortName
} }
} }
recurrence
canEdit canEdit
canDelete canDelete
} }
...@@ -59,15 +61,18 @@ query lessonsTeacher($teacher: ID!, $timeGrid: ID!) { ...@@ -59,15 +61,18 @@ query lessonsTeacher($teacher: ID!, $timeGrid: ID!) {
query lessonsRoom($room: ID!, $timeGrid: ID!) { query lessonsRoom($room: ID!, $timeGrid: ID!) {
lessonsRoom: lessonsForRoom(room: $room, timeGrid: $timeGrid) { lessonsRoom: lessonsForRoom(room: $room, timeGrid: $timeGrid) {
id id
slotStart { bundle {
id slotStart {
period id
weekday period
} weekday
slotEnd { }
id slotEnd {
period id
weekday period
weekday
}
recurrence
} }
subject { subject {
id id
...@@ -105,7 +110,6 @@ query lessonsRoom($room: ID!, $timeGrid: ID!) { ...@@ -105,7 +110,6 @@ query lessonsRoom($room: ID!, $timeGrid: ID!) {
shortName shortName
} }
} }
recurrence
canEdit canEdit
canDelete canDelete
} }
......
...@@ -24,7 +24,7 @@ class LessonType( ...@@ -24,7 +24,7 @@ class LessonType(
): ):
class Meta: class Meta:
model = Lesson model = Lesson
fields = ("id", "course", "rooms", "teachers", "subject") fields = ("id", "bundle", "course", "rooms", "teachers", "subject")
filter_fields = { filter_fields = {
"id": ["exact"], "id": ["exact"],
} }
......
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