mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-14 03:32:15 +00:00
Switch event representation such that properties can be extracted
This commit is contained in:
@@ -24,3 +24,6 @@ serde_json = "1.0.105"
|
||||
tokio = { version = "1.32.0", features = ["sync", "full"] }
|
||||
async-trait = "0.1.73"
|
||||
thiserror = "1.0.48"
|
||||
ical = { git = "https://github.com/Peltoche/ical-rs.git", rev = "4f7aeb0", features = [
|
||||
"generator",
|
||||
] }
|
||||
|
||||
@@ -60,7 +60,7 @@ impl<C: CalendarStore> Resource for EventResource<C> {
|
||||
write_string_prop(writer, "getetag", &self.event.get_etag())?;
|
||||
}
|
||||
"calendar-data" => {
|
||||
write_string_prop(writer, "C:calendar-data", self.event.as_ics())?;
|
||||
write_string_prop(writer, "C:calendar-data", &self.event.get_ics())?;
|
||||
}
|
||||
"getcontenttype" => {
|
||||
write_string_prop(writer, "getcontenttype", "text/calendar;charset=utf-8")?;
|
||||
|
||||
@@ -53,7 +53,7 @@ pub async fn get_event<A: CheckAuthentication, C: CalendarStore>(
|
||||
|
||||
Ok(HttpResponse::Ok()
|
||||
.insert_header(("ETag", event.get_etag()))
|
||||
.body(event.as_ics().to_string()))
|
||||
.body(event.get_ics()))
|
||||
}
|
||||
|
||||
pub async fn put_event<A: CheckAuthentication, C: CalendarStore>(
|
||||
|
||||
Reference in New Issue
Block a user