diff options
Diffstat (limited to 'app/services/api/api.ts')
-rw-r--r-- | app/services/api/api.ts | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/app/services/api/api.ts b/app/services/api/api.ts index 15f6815..4093d34 100644 --- a/app/services/api/api.ts +++ b/app/services/api/api.ts @@ -1,7 +1,7 @@ -import { ApisauceInstance, create, ApiResponse } from "apisauce" -import { getGeneralApiProblem } from "./api-problem" -import { ApiConfig, DEFAULT_API_CONFIG } from "./api-config" -import * as Types from "./api.types" +import { ApisauceInstance, create, ApiResponse } from 'apisauce' +import { getGeneralApiProblem } from './api-problem' +import { ApiConfig, DEFAULT_API_CONFIG } from './api-config' +import * as Types from './api.types' /** * Manages all requests to the API. @@ -39,7 +39,7 @@ export class Api { baseURL: this.config.url, timeout: this.config.timeout, headers: { - Accept: "application/json", + Accept: 'application/json', }, }) } @@ -68,9 +68,9 @@ export class Api { try { const rawUsers = response.data const resultUsers: Types.User[] = rawUsers.map(convertUser) - return { kind: "ok", users: resultUsers } + return { kind: 'ok', users: resultUsers } } catch { - return { kind: "bad-data" } + return { kind: 'bad-data' } } } @@ -94,9 +94,9 @@ export class Api { id: response.data.id, name: response.data.name, } - return { kind: "ok", user: resultUser } + return { kind: 'ok', user: resultUser } } catch { - return { kind: "bad-data" } + return { kind: 'bad-data' } } } } |