Refactor how ResourceService works

This commit is contained in:
Lennart
2025-01-04 14:24:01 +01:00
parent 40c8624703
commit c19e4745f9
16 changed files with 203 additions and 250 deletions

View File

@@ -57,17 +57,21 @@ pub fn configure_dav<AP: AuthenticationProvider, A: AddressbookStore + ?Sized>(
}),
)
.app_data(Data::from(store.clone()))
.service(RootResourceService::<PrincipalResource>::actix_resource())
.service(RootResourceService::<PrincipalResource>::default().actix_resource())
.service(
web::scope("/user").service(
web::scope("/{principal}")
.service(PrincipalResourceService::<A>::actix_resource())
.service(PrincipalResourceService::<A>::new(store.clone()).actix_resource())
.service(
web::scope("/{addressbook}")
.service(AddressbookResourceService::<A>::actix_resource())
.service(
AddressbookResourceService::<A>::new(store.clone())
.actix_resource(),
)
.service(
web::scope("/{object}").service(
AddressObjectResourceService::<A>::actix_resource(),
AddressObjectResourceService::<A>::new(store.clone())
.actix_resource(),
),
),
),