mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-04-09 10:00:51 -04:00
chore: move update socials schema (#50506)
* chore: move update scoials schema * fix: set maxLength value to satisfy tests
This commit is contained in:
@@ -80,24 +80,7 @@ export const settingRoutes: FastifyPluginCallbackTypebox = (
|
||||
fastify.put(
|
||||
'/update-my-socials',
|
||||
{
|
||||
schema: {
|
||||
body: Type.Object({
|
||||
website: Type.Optional(Type.String({ format: 'url' })),
|
||||
twitter: Type.Optional(Type.String({ format: 'url' })),
|
||||
githubProfile: Type.Optional(Type.String({ format: 'url' })),
|
||||
linkedin: Type.Optional(Type.String({ format: 'url' }))
|
||||
}),
|
||||
response: {
|
||||
200: Type.Object({
|
||||
message: Type.Literal('flash.updated-socials'),
|
||||
type: Type.Literal('success')
|
||||
}),
|
||||
500: Type.Object({
|
||||
message: Type.Literal('flash.wrong-updating'),
|
||||
type: Type.Literal('danger')
|
||||
})
|
||||
}
|
||||
}
|
||||
schema: schemas.updateMySocials
|
||||
},
|
||||
async (req, reply) => {
|
||||
try {
|
||||
|
||||
@@ -43,6 +43,26 @@ export const schemas = {
|
||||
})
|
||||
}
|
||||
},
|
||||
updateMySocials: {
|
||||
body: Type.Object({
|
||||
website: Type.Optional(Type.String({ format: 'url', maxLength: 1024 })),
|
||||
twitter: Type.Optional(Type.String({ format: 'url', maxLength: 1024 })),
|
||||
githubProfile: Type.Optional(
|
||||
Type.String({ format: 'url', maxLength: 1024 })
|
||||
),
|
||||
linkedin: Type.Optional(Type.String({ format: 'url', maxLength: 1024 }))
|
||||
}),
|
||||
response: {
|
||||
200: Type.Object({
|
||||
message: Type.Literal('flash.updated-socials'),
|
||||
type: Type.Literal('success')
|
||||
}),
|
||||
500: Type.Object({
|
||||
message: Type.Literal('flash.wrong-updating'),
|
||||
type: Type.Literal('danger')
|
||||
})
|
||||
}
|
||||
},
|
||||
updateMyKeyboardShortcuts: {
|
||||
body: Type.Object({
|
||||
keyboardShortcuts: Type.Boolean()
|
||||
|
||||
Reference in New Issue
Block a user