import TableEntry from "../models/TableEntry"; export default class UserStatsService { private apiURL = 'https://api.tsotr.humenius.me/stats' private requestInit: RequestInit = { method: 'GET', headers: { 'Content-Type': 'application/json' } }; async getStats(): Promise { return fetch(this.apiURL, this.requestInit) .then(res => this.checkResponse(res)) .then(data => data.json()) } private checkResponse(response: any): any { if (!response.ok) { throw Error(response.statusText); } return response; } }