# shellcheck shell=bash disable=SC2034,SC2154
# shellcheck disable=SC2039,3043
xrc:mod:lib     fjo     \
                team/repo/add   \
                team/repo/rm    \
                team/repo/ls

___x_cmd_fjo_team_repo(){
    param:subcmd ___x_cmd_fjo_team_repo                                                     \
        ls              "Lists a team's repositories visible to the authenticated user."    \
        add             "Add repository to team"                                            \
        rm              "rm org team repo"
    param:subcmd:try
    param:run


    ___x_cmd_fjo_team_repo _param_help_doc
    return 1
}


___x_cmd_fjo_team_repo____ui_handler(){
    if  [ -n "$ENFORCE_JSON" ] || [ -n "$json" ]; then
        ___x_cmd_cmds_cat
        ___x_cmd_fjo_http_error
        return
    fi
    (
        local msg
        local error_msg
        case "$1" in
            Add)
                ___x_cmd jo env . fjo_resp_err=.message error=.errors
                msg="[Success]: $1 $repo repo to ${org}/${id} team"
                error_msg="$1 $repo repo to ${org}/${id} team failure:"
                ;;
        esac

        if [ -z "$error" ]; then
            ___x_cmd_ui_tf true "$msg"
        else
            ___x_cmd_ui_tf false "$error_msg"
            ___x_cmd_fjo____handle_resp
            return 1
        fi
    )
}

