@@ -1376,7 +1376,7 @@ async fn delete_attachment_post_admin(
1376
1376
headers : Headers ,
1377
1377
conn : DbConn ,
1378
1378
nt : Notify < ' _ > ,
1379
- ) -> EmptyResult {
1379
+ ) -> JsonResult {
1380
1380
delete_attachment ( cipher_id, attachment_id, headers, conn, nt) . await
1381
1381
}
1382
1382
@@ -1387,7 +1387,7 @@ async fn delete_attachment_post(
1387
1387
headers : Headers ,
1388
1388
conn : DbConn ,
1389
1389
nt : Notify < ' _ > ,
1390
- ) -> EmptyResult {
1390
+ ) -> JsonResult {
1391
1391
delete_attachment ( cipher_id, attachment_id, headers, conn, nt) . await
1392
1392
}
1393
1393
@@ -1398,7 +1398,7 @@ async fn delete_attachment(
1398
1398
headers : Headers ,
1399
1399
mut conn : DbConn ,
1400
1400
nt : Notify < ' _ > ,
1401
- ) -> EmptyResult {
1401
+ ) -> JsonResult {
1402
1402
_delete_cipher_attachment_by_id ( & cipher_id, & attachment_id, & headers, & mut conn, & nt) . await
1403
1403
}
1404
1404
@@ -1409,7 +1409,7 @@ async fn delete_attachment_admin(
1409
1409
headers : Headers ,
1410
1410
mut conn : DbConn ,
1411
1411
nt : Notify < ' _ > ,
1412
- ) -> EmptyResult {
1412
+ ) -> JsonResult {
1413
1413
_delete_cipher_attachment_by_id ( & cipher_id, & attachment_id, & headers, & mut conn, & nt) . await
1414
1414
}
1415
1415
@@ -1818,7 +1818,7 @@ async fn _delete_cipher_attachment_by_id(
1818
1818
headers : & Headers ,
1819
1819
conn : & mut DbConn ,
1820
1820
nt : & Notify < ' _ > ,
1821
- ) -> EmptyResult {
1821
+ ) -> JsonResult {
1822
1822
let Some ( attachment) = Attachment :: find_by_id ( attachment_id, conn) . await else {
1823
1823
err ! ( "Attachment doesn't exist" )
1824
1824
} ;
@@ -1847,19 +1847,20 @@ async fn _delete_cipher_attachment_by_id(
1847
1847
)
1848
1848
. await ;
1849
1849
1850
- if let Some ( org_id) = cipher. organization_uuid {
1850
+ if let Some ( ref org_id) = cipher. organization_uuid {
1851
1851
log_event (
1852
1852
EventType :: CipherAttachmentDeleted as i32 ,
1853
1853
& cipher. uuid ,
1854
- & org_id,
1854
+ org_id,
1855
1855
& headers. user . uuid ,
1856
1856
headers. device . atype ,
1857
1857
& headers. ip . ip ,
1858
1858
conn,
1859
1859
)
1860
1860
. await ;
1861
1861
}
1862
- Ok ( ( ) )
1862
+ let cipher_json = cipher. to_json ( & headers. host , & headers. user . uuid , None , CipherSyncType :: User , conn) . await ;
1863
+ Ok ( Json ( json ! ( { "cipher" : cipher_json} ) ) )
1863
1864
}
1864
1865
1865
1866
/// This will hold all the necessary data to improve a full sync of all the ciphers
0 commit comments