mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-13 21:42:34 +00:00
frontend: Add error handling to collection forms
This commit is contained in:
@@ -87,7 +87,7 @@ let EditCalendarForm = class extends i {
|
||||
alert("No calendar components selected");
|
||||
return;
|
||||
}
|
||||
await fetch(`/caldav/principal/${this.principal}/${this.cal_id}`, {
|
||||
let response = await fetch(`/caldav/principal/${this.principal}/${this.cal_id}`, {
|
||||
method: "PROPPATCH",
|
||||
headers: {
|
||||
"Content-Type": "application/xml"
|
||||
@@ -114,6 +114,10 @@ let EditCalendarForm = class extends i {
|
||||
</propertyupdate>
|
||||
`
|
||||
});
|
||||
if (response.status >= 400) {
|
||||
alert(`Error ${response.status}: ${await response.text()}`);
|
||||
return null;
|
||||
}
|
||||
window.location.reload();
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user