Add new TODOs

This commit is contained in:
Pierre HUBERT 2023-06-16 18:47:08 +02:00
parent 9dd3811136
commit cffa8f40c2
2 changed files with 13 additions and 2 deletions

View File

@ -44,3 +44,13 @@ pub async fn add_member(
Ok(res) Ok(res)
}) })
} }
/// Remove a membership to a family
pub async fn remove_membership(family_id: FamilyID, user_id: UserID) {
todo!()
}
/// Remove all memberships of user
pub async fn remove_all_user_membership(user_id: UserID) -> anyhow::Result<()> {
todo!()
}

View File

@ -5,7 +5,7 @@ use crate::connections::db_connection;
use crate::constants::{ACCOUNT_DELETE_TOKEN_DURATION, PASSWORD_RESET_TOKEN_DURATION}; use crate::constants::{ACCOUNT_DELETE_TOKEN_DURATION, PASSWORD_RESET_TOKEN_DURATION};
use crate::models::{NewUser, User, UserID}; use crate::models::{NewUser, User, UserID};
use crate::schema::users; use crate::schema::users;
use crate::services::{login_token_service, mail_service}; use crate::services::{families_service, login_token_service, mail_service};
use crate::utils::string_utils::rand_str; use crate::utils::string_utils::rand_str;
use crate::utils::time_utils::time; use crate::utils::time_utils::time;
use bcrypt::DEFAULT_COST; use bcrypt::DEFAULT_COST;
@ -171,7 +171,8 @@ pub async fn delete_not_validated_accounts() -> anyhow::Result<()> {
pub async fn delete_account(user: &User) -> anyhow::Result<()> { pub async fn delete_account(user: &User) -> anyhow::Result<()> {
log::info!("Delete account #{:?}", user.id()); log::info!("Delete account #{:?}", user.id());
// TODO : remove families memberships // Remove families memberships
families_service::remove_all_user_membership(user.id()).await?;
login_token_service::disconnect_user_from_all_devices(user.id()).await?; login_token_service::disconnect_user_from_all_devices(user.id()).await?;