# shellcheck shell=bash disable=SC2034,SC2154
# https://gitea.com/api/swagger#/organization/orgDeleteTeam
___x_cmd_fjo_team_rm() {
    param:scope     ___x_cmd_fjo
    param:dsl       <<A
options:
    #1          "The slug of the team id."           <>
    --yes|-y    "Ignore remove prompt interception"
A
    param:run

    local teamid
    for teamid in "$@"; do
        {
            [ "$yes" = "true" ] || ___x_cmd_ui_yesno "Are you sure $org to remove team: $(___x_cmd_ui bold red "$teamid") ?" || continue
            ___x_cmd_fjo_curl del "/teams/${1}" | (
                x jo env . fjo_resp_err=.message
                if ___x_cmd_fjo_http_error; then
                    ___x_cmd_ui_tf  true "del team $teamid to organizations  success"
                else
                    ___x_cmd_ui_tf false "del team $teamid to organizations fail"
                    ___x_cmd_fjo____handle_resp
                    return 1
                fi
            )

        }
    done
}
