mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-19 09:45:37 -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
File diff suppressed because one or more lines are too long
|
@ -1,14 +1,14 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
||||
* SPDX-FileCopyrightText: 2025 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import type { RevisionDetails } from '../../../../../../api/revisions/types'
|
||||
import type { RevisionDto } from '@hedgedoc/commons'
|
||||
import { HttpMethod, respondToMatchingRequest } from '../../../../../../handler-utils/respond-to-matching-request'
|
||||
import type { NextApiRequest, NextApiResponse } from 'next'
|
||||
|
||||
const handler = (req: NextApiRequest, res: NextApiResponse): void => {
|
||||
respondToMatchingRequest<RevisionDetails>(HttpMethod.GET, req, res, {
|
||||
respondToMatchingRequest<RevisionDto>(HttpMethod.GET, req, res, {
|
||||
id: 0,
|
||||
createdAt: '2021-12-21T16:59:42.000Z',
|
||||
title: 'Features',
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
||||
* SPDX-FileCopyrightText: 2025 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import type { RevisionDetails } from '../../../../../../api/revisions/types'
|
||||
import type { RevisionDto } from '@hedgedoc/commons'
|
||||
import { HttpMethod, respondToMatchingRequest } from '../../../../../../handler-utils/respond-to-matching-request'
|
||||
import type { NextApiRequest, NextApiResponse } from 'next'
|
||||
|
||||
const handler = (req: NextApiRequest, res: NextApiResponse): void => {
|
||||
respondToMatchingRequest<RevisionDetails>(HttpMethod.GET, req, res, {
|
||||
respondToMatchingRequest<RevisionDto>(HttpMethod.GET, req, res, {
|
||||
id: 1,
|
||||
createdAt: '2021-12-29T17:54:11.000Z',
|
||||
title: 'Features',
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
||||
* SPDX-FileCopyrightText: 2025 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import type { RevisionMetadata } from '../../../../../../api/revisions/types'
|
||||
import type { RevisionMetadataDto } from '@hedgedoc/commons'
|
||||
import { HttpMethod, respondToMatchingRequest } from '../../../../../../handler-utils/respond-to-matching-request'
|
||||
import type { NextApiRequest, NextApiResponse } from 'next'
|
||||
|
||||
const handler = (req: NextApiRequest, res: NextApiResponse): void => {
|
||||
respondToMatchingRequest<RevisionMetadata[]>(HttpMethod.GET, req, res, [
|
||||
respondToMatchingRequest<RevisionMetadataDto[]>(HttpMethod.GET, req, res, [
|
||||
{
|
||||
id: 1,
|
||||
createdAt: '2021-12-29T17:54:11.000Z',
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
||||
* SPDX-FileCopyrightText: 2025 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import type { Note } from '../../../../api/notes/types'
|
||||
import { HttpMethod, respondToMatchingRequest } from '../../../../handler-utils/respond-to-matching-request'
|
||||
import type { NextApiRequest, NextApiResponse } from 'next'
|
||||
import type { NoteDto } from '@hedgedoc/commons'
|
||||
|
||||
const handler = (req: NextApiRequest, res: NextApiResponse): void => {
|
||||
respondToMatchingRequest<Note>(
|
||||
respondToMatchingRequest<NoteDto>(
|
||||
HttpMethod.POST,
|
||||
req,
|
||||
res,
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue