mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-06-01 23:58:58 -04:00
refactor(frontend): switch to DTOs from @hedgedoc/commons
Co-authored-by: Philip Molares <philip.molares@udo.edu> Signed-off-by: Philip Molares <philip.molares@udo.edu> Signed-off-by: Erik Michelson <github@erik.michelson.eu>
This commit is contained in:
parent
deee8e885f
commit
e411ddf099
121 changed files with 620 additions and 819 deletions
|
@ -1,11 +1,11 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2023 The HedgeDoc developers (see AUTHORS file)
|
||||
* SPDX-FileCopyrightText: 2025 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { GetApiRequestBuilder } from '../common/api-request-builder/get-api-request-builder'
|
||||
import type { FrontendConfig } from './types'
|
||||
import { isBuildTime } from '../../utils/test-modes'
|
||||
import type { FrontendConfigDto } from '@hedgedoc/commons'
|
||||
|
||||
/**
|
||||
* Fetches the frontend config from the backend.
|
||||
|
@ -13,10 +13,10 @@ import { isBuildTime } from '../../utils/test-modes'
|
|||
* @return The frontend config.
|
||||
* @throws {Error} when the api request wasn't successful.
|
||||
*/
|
||||
export const getConfig = async (baseUrl?: string): Promise<FrontendConfig | undefined> => {
|
||||
export const getConfig = async (baseUrl?: string): Promise<FrontendConfigDto | undefined> => {
|
||||
if (isBuildTime) {
|
||||
return undefined
|
||||
}
|
||||
const response = await new GetApiRequestBuilder<FrontendConfig>('config', baseUrl).sendRequest()
|
||||
const response = await new GetApiRequestBuilder<FrontendConfigDto>('config', baseUrl).sendRequest()
|
||||
return response.asParsedJsonObject()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue