JMAP for Contacts implementation (closes #1576)
This commit is contained in:
@@ -14,7 +14,7 @@ use crate::{
|
||||
},
|
||||
types::state::State,
|
||||
};
|
||||
use jmap_tools::Value;
|
||||
use jmap_tools::{Key, Map, Value};
|
||||
use serde::{Deserialize, Deserializer, Serialize};
|
||||
use types::{blob::BlobId, id::Id};
|
||||
use utils::map::vec_map::VecMap;
|
||||
@@ -168,3 +168,15 @@ impl<'de, T: JmapObject> Default for CopyRequest<'de, T> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: JmapObject> CopyResponse<T> {
|
||||
pub fn created(&mut self, id: Id, document_id: impl Into<T::Id>) {
|
||||
self.created.append(
|
||||
id,
|
||||
Value::Object(Map::from(vec![(
|
||||
Key::Property(T::ID_PROPERTY),
|
||||
Value::Element(T::Element::from(document_id.into())),
|
||||
)])),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user