A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/vuex-orm/plugin-axios/issues/82 below:

error ajax response is empty // TypeError: Cannot convert undefined or null to object · Issue #82 · vuex-orm/plugin-axios · GitHub

Hello

found error if ajax response is empty or null or cannot connect to api server
"TypeError: Cannot convert undefined or null to object"

    return this.model.insertOrUpdate({
      **data: this.getDataFromResponse(response, config) || []**
    })

Fixed

  private async persistResponseData(
    response: AxiosResponse,
    config: Config
  ): Promise<Collections | null> {
    if (!config.save) {
      return null
    }

    if (config.delete !== undefined) {
      await this.model.delete(config.delete as any)

      return null
    }

    return this.model.insertOrUpdate({
      data: this.getDataFromResponse(response, config) || []
    })
  }

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4