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

Add response schema to all API methods #247

Merged
merged 17 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions src/presentation/http/router/note.ts
neSpecc marked this conversation as resolved.
Show resolved Hide resolved
neSpecc marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,8 @@ const NoteRouter: FastifyPluginCallback<NoteRouterOptions> = (fastify, opts, don
},
},
body: {
updatedAt: {
type: 'string',
content: {
type: 'object',
},
},

Expand Down
21 changes: 15 additions & 6 deletions src/presentation/http/router/noteSettings.ts
neSpecc marked this conversation as resolved.
Show resolved Hide resolved
neSpecc marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,22 @@ const NoteSettingsRouter: FastifyPluginCallback<NoteSettingsRouterOptions> = (fa
},
},
body: {
properties: {
userId: {
$ref: 'NoteSettingsSchema#/properties/team/items/properties/id',
neSpecc marked this conversation as resolved.
Show resolved Hide resolved
},
newRole:{
$ref: 'NoteSettingsSchema#/properties/team/items/properties/role',
},
},
},

response: {
'2xx': {
description: 'Update notePublicId',
elizachi marked this conversation as resolved.
Show resolved Hide resolved
type: 'number',
properties: {
userId: {
$ref: 'NoteSettingsSchema#/properties/team/items/properties/id',
},
newRole:{
$ref: 'NoteSettingsSchema#/properties/team/items/properties/role',
newRole: {
type: 'number',
},
},
},
Expand All @@ -147,6 +155,7 @@ const NoteSettingsRouter: FastifyPluginCallback<NoteSettingsRouterOptions> = (fa
return reply.notFound('User does not belong to Note\'s team');
}


return reply.send(newRole);
});

Expand Down
Loading