Can change default account
This commit is contained in:
@ -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?;
|
||||
|
Reference in New Issue
Block a user