mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-06-20 16:35:17 +00:00
Can update data conservation policy
This commit is contained in:
@ -356,6 +356,13 @@ pub trait BaseRequestHandler {
|
||||
Ok(self.post_string(name)?.parse::<u64>()?)
|
||||
}
|
||||
|
||||
fn post_positive_u64_opt(&mut self, name: &str) -> Res<Option<u64>> {
|
||||
match self.post_u64(name)? {
|
||||
0 => Ok(None),
|
||||
val => Ok(Some(val))
|
||||
}
|
||||
}
|
||||
|
||||
/// Get a boolean included in a POST request
|
||||
fn post_bool(&mut self, name: &str) -> ResultBoxError<bool> {
|
||||
Ok(self.post_string(name)?.eq("true"))
|
||||
|
@ -34,6 +34,7 @@ pub mod survey_response;
|
||||
pub mod general_settings;
|
||||
pub mod lang_settings;
|
||||
pub mod security_settings;
|
||||
pub mod new_data_conservation_policy;
|
||||
pub mod new_custom_emoji;
|
||||
pub mod user_ws_message;
|
||||
pub mod user_ws_connection;
|
||||
|
15
src/data/new_data_conservation_policy.rs
Normal file
15
src/data/new_data_conservation_policy.rs
Normal file
@ -0,0 +1,15 @@
|
||||
//! # New data conservation policy settings
|
||||
//!
|
||||
//! @author Pierre Hubert
|
||||
|
||||
use crate::data::user::UserID;
|
||||
|
||||
pub struct NewDataConservationPolicy {
|
||||
pub user_id: UserID,
|
||||
pub delete_account_after: Option<u64>,
|
||||
pub delete_notifications_after: Option<u64>,
|
||||
pub delete_comments_after: Option<u64>,
|
||||
pub delete_posts_after: Option<u64>,
|
||||
pub delete_conversation_messages_after: Option<u64>,
|
||||
pub delete_likes_after: Option<u64>,
|
||||
}
|
Reference in New Issue
Block a user