Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added cover to patch note settings #261

Merged
merged 5 commits into from
Jul 1, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'
slaveeks marked this conversation as resolved.
Show resolved Hide resolved
}
},
},
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
slaveeks marked this conversation as resolved.
Show resolved Hide resolved
});

if (updatedNoteSettings === null) {
Expand Down
Loading