Can change default account

This commit is contained in:
2025-04-07 21:42:35 +02:00
parent 1977b5209c
commit 90bb4db806
3 changed files with 30 additions and 1 deletions

View File

@ -37,6 +37,13 @@ pub async fn update(account: AccountInPath, req: web::Json<UpdateAccountQuery>)
Ok(HttpResponse::Accepted().finish())
}
/// Set an account as the default one
pub async fn set_default(account: AccountInPath) -> HttpResult {
accounts_service::set_default(account.as_ref().user_id(), account.as_ref().id()).await?;
Ok(HttpResponse::Accepted().finish())
}
/// Delete an account
pub async fn delete(account: AccountInPath) -> HttpResult {
accounts_service::delete(account.as_ref().id()).await?;