# shellcheck shell=bash disable=SC2034,SC2154
#TODO: APIEmpty is an empty response
# https://gitea.com/api/swagger#/organization/orgAddTeamRepository
___x_cmd_fjo_team_repo_add() {
    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"                            <>

    --json|-j       "output json data"
A
    param:run

    local repo="$1"
    local gen_fjo_json
    gen_fjo_json="$(param:option2json -org -id)"

    ___x_cmd_fjo_curl put "/teams/$id/repos/$org/$repo" "gen_fjo_json" | ___x_cmd_fjo_team_repo____ui_handler Add
}