Make "name" attribute optional in Attachment object

This commit is contained in:
silverpill 2021-11-18 16:50:42 +00:00
parent fc24ba0e59
commit d104b32d5e

View file

@ -15,7 +15,7 @@ use super::vocabulary::*;
#[derive(Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct Attachment {
pub name: String,
pub name: Option<String>,
#[serde(rename = "type")]
pub attachment_type: String,
@ -131,7 +131,7 @@ pub fn create_note(
let url = get_file_url(instance_url, &db_item.file_name);
let media_type = db_item.media_type.clone().unwrap_or("".to_string());
Attachment {
name: "".to_string(),
name: None,
attachment_type: DOCUMENT.to_string(),
media_type,
url,