(
userId: string,
name: string,
color: string,
)
| 119 | } |
| 120 | |
| 121 | static async create( |
| 122 | userId: string, |
| 123 | name: string, |
| 124 | color: string, |
| 125 | ): Promise<void> { |
| 126 | const calendarId = crypto.randomUUID(); |
| 127 | const calendarUrl = `${calendarConfig.calDavUrl}/${userId}/${calendarId}/`; |
| 128 | |
| 129 | const client = await getClient(userId); |
| 130 | |
| 131 | await client.makeCalendar({ |
| 132 | url: calendarUrl, |
| 133 | props: { |
| 134 | displayname: name, |
| 135 | }, |
| 136 | }); |
| 137 | |
| 138 | // Cannot properly set color with makeCalendar, so we quickly update it instead |
| 139 | await this.update(userId, calendarUrl, name, color); |
| 140 | } |
| 141 | |
| 142 | static async update( |
| 143 | userId: string, |
nothing calls this directly
no test coverage detected