Skip to content

Commit

Permalink
feat: added cover to patch note settings
Browse files Browse the repository at this point in the history
  • Loading branch information
slaveeks committed Jul 1, 2024
1 parent 07e5e4a commit f465299
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/presentation/http/router/noteSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ const NoteSettingsRouter: FastifyPluginCallback<NoteSettingsRouterOptions> = (fa
* Patch noteSettings by note id
*/
fastify.patch<{
Body: Pick<NoteSettings, 'customHostname' | 'isPublic'>;
Body: Pick<NoteSettings, 'customHostname' | 'isPublic' | 'cover'>;
Params: {
notePublicId: NotePublicId;
};
Expand All @@ -243,6 +243,9 @@ const NoteSettingsRouter: FastifyPluginCallback<NoteSettingsRouterOptions> = (fa
isPublic: {
type: 'boolean',
},
cover: {
type: 'string'
}
},
},
response: {
Expand All @@ -260,11 +263,12 @@ const NoteSettingsRouter: FastifyPluginCallback<NoteSettingsRouterOptions> = (fa
/**
* @todo validate data
*/
const { customHostname, isPublic } = request.body;
const { customHostname, isPublic, cover } = request.body;

const updatedNoteSettings = await noteSettingsService.patchNoteSettingsByNoteId(noteId, {
customHostname,
isPublic,
cover
});

if (updatedNoteSettings === null) {
Expand Down

0 comments on commit f465299

Please sign in to comment.