hedgedoc/src/api/backend-config/index.ts
mrdrogdrog 570c45017c
Restructure redux code (#109)
* Restructure redux code

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
Co-authored-by: Erik Michelson <github@erik.michelson.eu>
2020-05-31 22:51:36 +02:00

8 lines
334 B
TypeScript

import { expectResponseCode, getBackendUrl } from '../../utils/apiUtils'
import { BackendConfig } from './types'
export const getBackendConfig = async (): Promise<BackendConfig> => {
const response = await fetch(getBackendUrl() + '/config')
expectResponseCode(response)
return await response.json() as Promise<BackendConfig>
}