[#574] can now remove the description of the calendar (#591)

This commit is contained in:
Camille Moussu
2026-03-03 16:16:23 +01:00
committed by GitHub
parent 4591a31599
commit 74c903ecd0
+5 -11
View File
@@ -88,22 +88,16 @@ export async function proppatchCalendar(
calLink: string, calLink: string,
patch: { name: string; desc: string; color: Record<string, string> } patch: { name: string; desc: string; color: Record<string, string> }
) { ) {
const body: Record<string, string> = {};
if (patch.name) {
body["dav:name"] = patch.name;
}
if (patch.desc) {
body["caldav:description"] = patch.desc;
}
if (patch.color.light) {
body["apple:color"] = patch.color.light;
}
const response = await api(`dav${calLink}`, { const response = await api(`dav${calLink}`, {
method: "PROPPATCH", method: "PROPPATCH",
headers: { headers: {
Accept: "application/json, text/plain, */*", Accept: "application/json, text/plain, */*",
}, },
body: JSON.stringify(body), body: JSON.stringify({
"dav:name": patch.name,
"caldav:description": patch.desc,
"apple:color": patch.color.light,
}),
}); });
return response; return response;
} }