Add calendar-order prop

This commit is contained in:
Lennart
2024-06-01 22:00:07 +02:00
parent 22b6f63d3b
commit d647e45e5c
5 changed files with 14 additions and 3 deletions

View File

@@ -36,6 +36,7 @@ pub struct MkcolCalendarProp {
displayname: Option<String>,
calendar_description: Option<String>,
calendar_color: Option<String>,
order: Option<i64>,
calendar_timezone: Option<String>,
supported_calendar_component_set: Option<SupportedCalendarComponentSetElement>,
}
@@ -69,6 +70,7 @@ pub async fn route_mkcol_calendar<A: CheckAuthentication, C: CalendarStore + ?Si
let calendar = Calendar {
id: cid.to_owned(),
owner: principal,
order: request.order.unwrap_or(0),
name: request.displayname,
timezone: request.calendar_timezone,
color: request.calendar_color,

View File

@@ -124,6 +124,7 @@ pub enum CalendarProp {
Displayname,
CalendarColor,
CalendarDescription,
CalendarOrder,
SupportedCalendarComponentSet,
SupportedCalendarData,
Getcontenttype,
@@ -142,6 +143,8 @@ pub enum CalendarPropResponse {
CalendarColor(TextNode),
#[serde(rename = "C:calendar-description", alias = "calendar-description")]
CalendarDescription(TextNode),
#[serde(rename = "IC:calendar-description", alias = "calendar-description")]
CalendarOrder(TextNode),
#[serde(
rename = "C:supported-calendar-component-set",
alias = "supported-calendar-component-set"
@@ -193,6 +196,9 @@ impl Resource for CalendarFile {
CalendarProp::CalendarDescription => Ok(CalendarPropResponse::CalendarDescription(
TextNode(self.calendar.description.clone()),
)),
CalendarProp::CalendarOrder => Ok(CalendarPropResponse::CalendarOrder(TextNode(
format!("{}", self.calendar.order).into(),
))),
CalendarProp::SupportedCalendarComponentSet => {
Ok(CalendarPropResponse::SupportedCalendarComponentSet(
SupportedCalendarComponentSet {