@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user