✨ Make history API compatible with frontend
This commit is contained in:
@ -101,6 +101,9 @@ export async function getHistory(req, res) {
|
||||
include: {
|
||||
substitution: true,
|
||||
},
|
||||
orderBy: {
|
||||
createdAt: "desc",
|
||||
},
|
||||
};
|
||||
if (requestedClass) {
|
||||
prismaOptions.where.substitution.class = { has: requestedClass };
|
||||
|
@ -130,7 +130,17 @@ export class Parser {
|
||||
data: {
|
||||
substitutionId: newSubstitution.id,
|
||||
type: "addition",
|
||||
changes: {},
|
||||
changes: {
|
||||
class: classes,
|
||||
type: change.type == "Entfall" ? "cancellation" : "change",
|
||||
lesson: parseInt(change.lesson),
|
||||
date: new Date(date),
|
||||
change: {
|
||||
teacher: change.changedTeacher,
|
||||
room: change.room || undefined,
|
||||
subject: change.subject,
|
||||
},
|
||||
},
|
||||
parseEventId: parseEvent.id,
|
||||
},
|
||||
});
|
||||
|
Reference in New Issue
Block a user