Skip to content

Commit

Permalink
fixed request params
Browse files Browse the repository at this point in the history
  • Loading branch information
slaveeks committed Oct 21, 2023
1 parent 0363677 commit 17ffa3e
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions src/presentation/http/router/noteSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,7 @@ import type NoteSettings from '@domain/entities/noteSettings.js';
import notEmpty from '@infrastructure/utils/notEmpty.js';
import useNoteResolver from '../middlewares/note/useNoteResolver.js';
import type NoteService from '@domain/service/note.js';

/**
* Get note by id options
*/
interface GetNoteSettingsByNodeIdOptions {
/**
* Note internal id
*/
id: NoteInternalId;
}
import { NotePublicId } from '@domain/entities/note.js';

/**
* Interface for the note settings router.
Expand Down Expand Up @@ -55,7 +46,9 @@ const NoteSettingsRouter: FastifyPluginCallback<NoteSettingsRouterOptions> = (fa
* Returns Note settings by note id. Note public id is passed in route params, and it converted to internal id via middleware
*/
fastify.get<{
Params: GetNoteSettingsByNodeIdOptions,
Params: {
notePublicId: NotePublicId;
},
Reply: NoteSettings
}>('/:notePublicId', {
preHandler: [
Expand Down Expand Up @@ -84,7 +77,9 @@ const NoteSettingsRouter: FastifyPluginCallback<NoteSettingsRouterOptions> = (fa
*/
fastify.patch<{
Body: Partial<NoteSettings>,
Params: GetNoteSettingsByNodeIdOptions,
Params: {
notePublicId: NotePublicId;
},
Reply: NoteSettings,
}>('/:notePublicId', {
config: {
Expand Down

0 comments on commit 17ffa3e

Please sign in to comment.