MCPcopy Create free account
hub / github.com/bewcloud/bewcloud / create

Method create

lib/models/calendar.ts:121–140  ·  view source on GitHub ↗
(
    userId: string,
    name: string,
    color: string,
  )

Source from the content-addressed store, hash-verified

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,

Callers

nothing calls this directly

Calls 3

updateMethod · 0.95
makeCalendarMethod · 0.80
getClientFunction · 0.70

Tested by

no test coverage detected