calendar fixes

This commit is contained in:
Julian Krauser 2024-10-28 16:02:56 +01:00
parent 136da08b70
commit 8c597fd68d
8 changed files with 70 additions and 27 deletions

View file

@ -1,22 +1,24 @@
export interface CreateCalendarCommand {
date: Date;
starttime: Date;
endtime: Date;
title: string;
content: string;
location: string;
allDay: boolean;
typeId: number;
}
export interface UpdateCalendarCommand {
id: number;
date: Date;
id: string;
starttime: Date;
endtime: Date;
title: string;
content: string;
location: string;
allDay: boolean;
typeId: number;
}
export interface DeleteCalendarCommand {
id: number;
id: string;
}

View file

@ -16,11 +16,12 @@ export default abstract class CalendarCommandHandler {
.insert()
.into(calendar)
.values({
date: createCalendar.date,
starttime: createCalendar.starttime,
endtime: createCalendar.endtime,
title: createCalendar.title,
content: createCalendar.content,
location: createCalendar.location,
allDay: createCalendar.allDay,
type: await dataSource
.getRepository(calendarType)
.createQueryBuilder("type")
@ -46,11 +47,12 @@ export default abstract class CalendarCommandHandler {
.createQueryBuilder()
.update(calendar)
.set({
date: updateCalendar.date,
starttime: updateCalendar.starttime,
endtime: updateCalendar.endtime,
title: updateCalendar.title,
content: updateCalendar.content,
location: updateCalendar.location,
allDay: updateCalendar.allDay,
type: await dataSource
.getRepository(calendarType)
.createQueryBuilder("type")