From 1374c7db0d138f6c8d0a9efa94ef5eaa3a1b736b Mon Sep 17 00:00:00 2001 From: max Date: Sat, 3 Feb 2024 17:44:13 -0300 Subject: [PATCH] routes update after the merger --- src/controller/project/routes.ts | 3 +++ src/controller/user/routes.ts | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/controller/project/routes.ts b/src/controller/project/routes.ts index 225fee4..56d051b 100644 --- a/src/controller/project/routes.ts +++ b/src/controller/project/routes.ts @@ -9,6 +9,9 @@ import fastifyStatic from '@fastify/static' import { getProjectsByTags } from './getProjectsByTags' import { editProject } from './editProjectById' import { deleteProjectById } from './deleteProjectById' +import getProjectByUserIdSchema from './swagger/getProjectsByUserIdSwagger.json' +import getProjectByIdSchema from './swagger/getProjectByIDSwagger.json' +import createProjectSwagger from './swagger/createProjectSwagger.json' export async function projectRoutes(app: FastifyInstance) { app.register(FastifyMultipart, { diff --git a/src/controller/user/routes.ts b/src/controller/user/routes.ts index c5387ce..8a2d1ad 100644 --- a/src/controller/user/routes.ts +++ b/src/controller/user/routes.ts @@ -5,6 +5,8 @@ import { registerUser } from './registerUser' import { editUserById } from './editUserById' import { addImageUser } from './addImageToUser' import FastifyMultipart from '@fastify/multipart' +import getUserByIdSchema from './Swagger/getUserByIdSchema.json' +import registerUserSchema from './Swagger/registerUserSchema.json' export async function userRoutes(app: FastifyInstance) { app.register(FastifyMultipart, { @@ -13,8 +15,8 @@ export async function userRoutes(app: FastifyInstance) { fileSize: 1000000, // the max file size in bytes }, }) - app.post('/user', registerUser) - app.get('/user/:id', getUserById) + app.post('/user', registerUserSchema, registerUser) + app.get('/user/:id', getUserByIdSchema, getUserById) app.get('/user', getUserByEmail) app.put('/user/:userId/edit', editUserById) app.post('/user/:userId/photo', addImageUser)