Fix me-API-request to use fetch-config and API-path (#381)

* Move mocked me-API-response into API dir

* Update me-API request to use API path and fetch-config
This commit is contained in:
Erik Michelson 2020-08-03 23:40:04 +02:00 committed by GitHub
parent 57baf2fab5
commit c21503848f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -3,7 +3,9 @@ import { expectResponseCode, getApiUrl } from '../utils/apiUtils'
import { defaultFetchConfig } from './default'
export const getMe = async (): Promise<meResponse> => {
const response = await fetch('/me')
const response = await fetch(getApiUrl() + '/me', {
...defaultFetchConfig
})
expectResponseCode(response)
return (await response.json()) as meResponse
}