mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-14 05:52:19 +00:00
Refactoring
This commit is contained in:
@@ -9,12 +9,9 @@ use actix_web::{
|
||||
HttpRequest,
|
||||
};
|
||||
use rustical_dav::{
|
||||
methods::propfind::{PropElement, PropfindType},
|
||||
resource::{CommonPropertiesProp, EitherProp, Resource},
|
||||
xml::{
|
||||
multistatus::{PropstatWrapper, ResponseElement},
|
||||
MultistatusElement,
|
||||
},
|
||||
xml::{multistatus::ResponseElement, MultistatusElement},
|
||||
xml::{PropElement, PropfindType},
|
||||
};
|
||||
use rustical_store::{auth::User, AddressObject, AddressbookStore};
|
||||
use serde::Deserialize;
|
||||
@@ -68,13 +65,8 @@ pub async fn handle_addressbook_multiget<AS: AddressbookStore + ?Sized>(
|
||||
principal: &str,
|
||||
cal_id: &str,
|
||||
addr_store: &AS,
|
||||
) -> Result<
|
||||
MultistatusElement<
|
||||
PropstatWrapper<EitherProp<AddressObjectProp, CommonPropertiesProp>>,
|
||||
String,
|
||||
>,
|
||||
Error,
|
||||
> {
|
||||
) -> Result<MultistatusElement<EitherProp<AddressObjectProp, CommonPropertiesProp>, String>, Error>
|
||||
{
|
||||
let principal_url = PrincipalResource::get_url(req.resource_map(), vec![principal]).unwrap();
|
||||
let (objects, not_found) = get_objects_addressbook_multiget(
|
||||
&addr_multiget,
|
||||
|
||||
@@ -4,12 +4,9 @@ use crate::{
|
||||
};
|
||||
use actix_web::{http::StatusCode, HttpRequest};
|
||||
use rustical_dav::{
|
||||
methods::propfind::{PropElement, PropfindType},
|
||||
resource::{CommonPropertiesProp, EitherProp, Resource},
|
||||
xml::{
|
||||
multistatus::{PropstatWrapper, ResponseElement},
|
||||
MultistatusElement,
|
||||
},
|
||||
xml::{multistatus::ResponseElement, MultistatusElement},
|
||||
xml::{PropElement, PropfindType},
|
||||
};
|
||||
use rustical_store::{
|
||||
auth::User,
|
||||
@@ -47,13 +44,8 @@ pub async fn handle_sync_collection<AS: AddressbookStore + ?Sized>(
|
||||
principal: &str,
|
||||
addressbook_id: &str,
|
||||
addr_store: &AS,
|
||||
) -> Result<
|
||||
MultistatusElement<
|
||||
PropstatWrapper<EitherProp<AddressObjectProp, CommonPropertiesProp>>,
|
||||
String,
|
||||
>,
|
||||
Error,
|
||||
> {
|
||||
) -> Result<MultistatusElement<EitherProp<AddressObjectProp, CommonPropertiesProp>, String>, Error>
|
||||
{
|
||||
let props = match sync_collection.prop {
|
||||
PropfindType::Allprop => {
|
||||
vec!["allprop".to_owned()]
|
||||
|
||||
11
crates/carddav/tests/integration_test.rs
Normal file
11
crates/carddav/tests/integration_test.rs
Normal file
@@ -0,0 +1,11 @@
|
||||
use actix_web::{web, App};
|
||||
use rustical_carddav::configure_dav;
|
||||
|
||||
#[actix_web::test]
|
||||
async fn test_asd() {
|
||||
let app = App::new().service(web::scope("/carddav").configure(
|
||||
|config| configure_dav(config, auth_provider, store)
|
||||
));
|
||||
let app = actix_web::test::init_service()
|
||||
assert!(false);
|
||||
}
|
||||
Reference in New Issue
Block a user