mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-20 10:15:17 -04:00
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:
parent
57baf2fab5
commit
c21503848f
2 changed files with 3 additions and 1 deletions
|
@ -3,7 +3,9 @@ import { expectResponseCode, getApiUrl } from '../utils/apiUtils'
|
||||||
import { defaultFetchConfig } from './default'
|
import { defaultFetchConfig } from './default'
|
||||||
|
|
||||||
export const getMe = async (): Promise<meResponse> => {
|
export const getMe = async (): Promise<meResponse> => {
|
||||||
const response = await fetch('/me')
|
const response = await fetch(getApiUrl() + '/me', {
|
||||||
|
...defaultFetchConfig
|
||||||
|
})
|
||||||
expectResponseCode(response)
|
expectResponseCode(response)
|
||||||
return (await response.json()) as meResponse
|
return (await response.json()) as meResponse
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue