Fix creating and deleting calendars

This fixes the creation and deletion of calendars to include a color and the proper chosen name.
This commit is contained in:
Bruno Bernardino
2025-09-06 19:17:48 +01:00
parent 24944de0f6
commit 49dbc724c8
8 changed files with 30 additions and 10 deletions

View File

@@ -120,6 +120,7 @@ export class CalendarModel {
static async create(
userId: string,
name: string,
color: string,
): Promise<void> {
const calendarId = crypto.randomUUID();
const calendarUrl = `${calendarConfig.calDavUrl}/${userId}/${calendarId}/`;
@@ -129,7 +130,8 @@ export class CalendarModel {
await client.makeCalendar({
url: calendarUrl,
props: {
displayName: name,
displayname: name,
calendarColor: color,
},
});
}
@@ -163,8 +165,10 @@ export class CalendarModel {
static async delete(
userId: string,
calendarUrl: string,
calendarId: string,
): Promise<void> {
const calendarUrl = `${calendarConfig.calDavUrl}/${userId}/${calendarId}/`;
const client = await getClient(userId);
await client.deleteObject({