# shellcheck shell=dash disable=SC2154,SC2034

# This function is used to remove an existing alert
___x_cmd_shodan_alert_rm(){
    local X_help_cmd='x help -m shodan alert rm';   help:arg-null:parse
    local id="$1"
    [ -n "$id" ] ||  N=shodan M="Provide an alert ID" log:ret:1

    local error=
    ___x_cmd_shodan_curl del "/shodan/alert/${id}" | x jo env .error

    if [ -n "$error" ]; then
        shodan:error "$error"
        return 1
    else
        shodan:info "Removed alert[id=$id] successfully"
    fi

}

