|
|
|
@ -80,6 +80,7 @@ pub struct SendData { |
|
|
|
deletion_date: DateTime<Utc>, |
|
|
|
disabled: bool, |
|
|
|
hide_email: Option<bool>, |
|
|
|
emails: Option<String>, |
|
|
|
|
|
|
|
// Data field
|
|
|
|
name: String, |
|
|
|
@ -150,6 +151,10 @@ fn create_send(data: SendData, user_id: UserId) -> ApiResult<Send> { |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
if data.emails.is_some() { |
|
|
|
err!("Sends with email verification is not supported"); |
|
|
|
} |
|
|
|
|
|
|
|
let mut send = Send::new(data.r#type, data.name, data_str, data.key, data.deletion_date.naive_utc()); |
|
|
|
send.user_uuid = Some(user_id); |
|
|
|
send.notes = data.notes; |
|
|
|
@ -635,6 +640,10 @@ async fn put_send(send_id: SendId, data: Json<SendData>, headers: Headers, conn: |
|
|
|
err!("Send not found", "Send send_id is invalid or does not belong to user") |
|
|
|
}; |
|
|
|
|
|
|
|
if data.emails.is_some() { |
|
|
|
err!("Sends with email verification is not supported"); |
|
|
|
} |
|
|
|
|
|
|
|
update_send_from_data(&mut send, data, &headers, &conn, &nt, UpdateType::SyncSendUpdate).await?; |
|
|
|
|
|
|
|
Ok(Json(send.to_json())) |
|
|
|
|