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,12 @@
|
|||
/*
|
||||
* 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 type { LoginUserInfo } from '../../../../api/me/types'
|
||||
import { HttpMethod, respondToMatchingRequest } from '../../../../handler-utils/respond-to-matching-request'
|
||||
import type { NextApiRequest, NextApiResponse } from 'next'
|
||||
import type { LoginUserInfoDto } from '@hedgedoc/commons'
|
||||
import { ProviderType } from '@hedgedoc/commons'
|
||||
|
||||
const handler = (req: NextApiRequest, res: NextApiResponse): void => {
|
||||
const cookieSet = req.headers?.['cookie']?.split(';').find((value) => value.trim() === 'mock-session=1') !== undefined
|
||||
|
@ -13,11 +14,11 @@ const handler = (req: NextApiRequest, res: NextApiResponse): void => {
|
|||
res.status(403).json({})
|
||||
return
|
||||
}
|
||||
respondToMatchingRequest<LoginUserInfo>(HttpMethod.GET, req, res, {
|
||||
respondToMatchingRequest<LoginUserInfoDto>(HttpMethod.GET, req, res, {
|
||||
username: 'mock',
|
||||
photoUrl: '/public/img/avatar.png',
|
||||
displayName: 'Mock User',
|
||||
authProvider: 'local',
|
||||
authProvider: ProviderType.LOCAL,
|
||||
email: 'mock@hedgedoc.test'
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue