|
@ -492,7 +492,10 @@ fn post_attachment(uuid: String, data: Data, content_type: &ContentType, headers |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
let attachment = Attachment::new(file_name, cipher.uuid.clone(), name, size); |
|
|
let attachment = Attachment::new(file_name, cipher.uuid.clone(), name, size); |
|
|
attachment.save(&conn); |
|
|
match attachment.save(&conn) { |
|
|
|
|
|
Ok(()) => (), |
|
|
|
|
|
Err(_) => println!("Error: failed to save attachment") |
|
|
|
|
|
}; |
|
|
}).expect("Error processing multipart data"); |
|
|
}).expect("Error processing multipart data"); |
|
|
|
|
|
|
|
|
Ok(Json(cipher.to_json(&headers.host, &headers.user.uuid, &conn))) |
|
|
Ok(Json(cipher.to_json(&headers.host, &headers.user.uuid, &conn))) |
|
|