public sendByFetch()

in src/services/report.ts [36:52]


  public sendByFetch(data: any) {
    delete data.collector;
    if (!this.url) {
      return;
    }
    const sendRequest = new Request(this.url, { method: 'POST', body: JSON.stringify(data) });

    fetch(sendRequest)
      .then((response) => {
        if (response.status >= 400 || response.status === 0) {
          throw new Error('Something went wrong on api server!');
        }
      })
      .catch((error) => {
        console.error(error);
      });
  }