Skip to content

Commit

Permalink
iam:fix apps batch delete
Browse files Browse the repository at this point in the history
  • Loading branch information
ljl committed Jan 27, 2024
1 parent b8aba57 commit 37e4d22
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions support/iam/src/console_tenant/api/iam_ct_app_set_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,21 @@ impl IamCtAppSetApi {
TardisResp::ok(Void {})
}

/// batch Delete App Set Item (App Or Account) By App Set Item Id
#[oai(path = "/item/batch/:ids", method = "delete")]
async fn delete_item(&self, ids: Path<String>, ctx: TardisContextExtractor, request: &Request) -> TardisApiResult<Void> {
let mut funs = iam_constants::get_tardis_inst();
funs.begin().await?;
let ctx = IamCertServ::use_sys_or_tenant_ctx_unsafe(ctx.0)?;
add_remote_ip(request, &ctx).await?;
for id in ids.split(',').collect::<Vec<_>>() {
IamSetServ::delete_set_item(&id, &funs, &ctx).await?;
}
funs.commit().await?;
ctx.execute_task().await?;
TardisResp::ok(Void {})
}

/// Check App Scope with Account
#[oai(path = "/scope", method = "get")]
async fn check_scope(&self, app_id: Query<String>, account_id: Query<Option<String>>, ctx: TardisContextExtractor, request: &Request) -> TardisApiResult<bool> {
Expand Down

0 comments on commit 37e4d22

Please sign in to comment.