# shellcheck shell=dash disable=SC2034,SC2154
# https://gitea.com/api/swagger#/organization/orgRemoveTeamRepository
___x_cmd_fjo_team_repo_rm() {
    param:scope     ___x_cmd_fjo
    param:dsl       <<A
options:
    #1              "name of the repo to add"                   <>:RepoName
    --org           "The organization name"                     <>:Address
    --id            "id of the team"                            <>

    --yes|-y        "Ignore remove prompt interception"
A
    param:run

    local repo="$1"
    [ "$yes" = "true" ] || ___x_cmd_ui_yesno "Are you sure $(___x_cmd_ui bold red "$id") team remove the repo: $(___x_cmd_ui bold red "$repo") ?" || return
    ___x_cmd_fjo_curl del "/teams/$id/repos/$org/$repo" | (
        x jo env . fjo_resp_err=.message
        if ___x_cmd_fjo_http_error; then
            ___x_cmd_ui_tf  true "del repo $repo  success"
        else
            ___x_cmd_ui_tf false "del repo failure: $repo."
            ___x_cmd_fjo____handle_resp
            return 1
        fi
    )
}