Lots of refactoring around routing

This commit is contained in:
Lennart
2025-06-02 19:41:30 +02:00
parent 08c4bd4289
commit b7c24fe2f0
13 changed files with 245 additions and 212 deletions

View File

@@ -1,5 +1,6 @@
use super::methods::{get_event, put_event};
use crate::{CalDavPrincipalUri, Error};
use actix_web::web;
use async_trait::async_trait;
use derive_more::derive::{From, Into};
use rustical_dav::{
@@ -149,8 +150,11 @@ impl<C: CalendarStore> ResourceService for CalendarObjectResourceService<C> {
Ok(())
}
#[inline]
fn actix_additional_routes(res: actix_web::Resource) -> actix_web::Resource {
res.get(get_event::<C>).put(put_event::<C>)
fn actix_scope(self) -> actix_web::Scope {
web::scope("/{object_id}.ics").service(
self.actix_resource()
.get(get_event::<C>)
.put(put_event::<C>),
)
}
}