mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-13 22:52:22 +00:00
Improve routing
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
use super::methods::mkcol::route_mkcol;
|
||||
use super::methods::report::route_report_addressbook;
|
||||
use super::prop::{SupportedAddressData, SupportedReportSet};
|
||||
use crate::address_object::resource::AddressObjectResource;
|
||||
use crate::address_object::resource::{AddressObjectResource, AddressObjectResourceService};
|
||||
use crate::{CardDavPrincipalUri, Error};
|
||||
use async_trait::async_trait;
|
||||
use axum::Router;
|
||||
use axum::extract::Request;
|
||||
use axum::handler::Handler;
|
||||
use axum::response::Response;
|
||||
@@ -266,6 +267,15 @@ impl<AS: AddressbookStore, S: SubscriptionStore> ResourceService
|
||||
.await?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn axum_router<State: Send + Sync + Clone + 'static>(self) -> Router<State> {
|
||||
Router::new()
|
||||
.nest(
|
||||
"/{object_id}",
|
||||
AddressObjectResourceService::new(self.addr_store.clone()).axum_router(),
|
||||
)
|
||||
.route_service("/", self.axum_service())
|
||||
}
|
||||
}
|
||||
|
||||
impl<AS: AddressbookStore, S: SubscriptionStore> AxumMethods for AddressbookResourceService<AS, S> {
|
||||
|
||||
Reference in New Issue
Block a user