diff --git a/src/module/auth/auth.route.ts b/src/module/auth/auth.route.ts index bef5977..705d1b4 100644 --- a/src/module/auth/auth.route.ts +++ b/src/module/auth/auth.route.ts @@ -21,28 +21,40 @@ authRouter.get( authRouter.post( "/register", - // #swagger.tags = ['auth'] + /* #swagger.tags = ['auth'] + #swagger.requestBody = { + schema: { $ref: "#/components/schemas/RegisterSchema" } + } */ validator(registerSchema), authController.register, ); authRouter.post( "/login", - // #swagger.tags = ['auth'] + /* #swagger.tags = ['auth'] + #swagger.requestBody = { + schema: { $ref: "#/components/schemas/LoginSchema" } + } */ validator(loginSchema), authController.login, ); authRouter.post( "/google", - // #swagger.tags = ['auth'] + /* #swagger.tags = ['auth'] + #swagger.requestBody = { + schema: { $ref: "#/components/schemas/OAuthSchema" } + } */ validator(oAuthSchema), authController.googleAuth, ); authRouter.post( "/fcm-token", - // #swagger.tags = ['auth'] + /* #swagger.tags = ['auth'] + #swagger.requestBody = { + schema: { $ref: "#/components/schemas/FCMTokenSchema" } + } */ jwtAuthMiddleware, validator(fcmTokenSchema), authController.updateFCMToken, diff --git a/src/module/chat/chat.route.ts b/src/module/chat/chat.route.ts index 8430a9e..f0673d3 100644 --- a/src/module/chat/chat.route.ts +++ b/src/module/chat/chat.route.ts @@ -18,7 +18,10 @@ chatRouter.use(jwtAuthMiddleware); chatRouter.post( "/rooms", - // #swagger.tags = ['chat'] + /* #swagger.tags = ['chat'] + #swagger.requestBody = { + schema: { $ref: "#/components/schemas/CreateRoomSchema" } + } */ validator(createRoomSchema), chatController.createRoom, ); @@ -38,20 +41,34 @@ chatRouter.get( // - For now i seperate it because of issue in zod that can't validate the request body properly chatRouter.post( "/rooms/:roomId/messages/text", - // #swagger.tags = ['chat'] + /* #swagger.tags = ['chat'] + #swagger.requestBody = { + schema: { $ref: "#/components/schemas/SendTextMessageSchema" } + } */ validator(sendTextMessageSchema), chatController.sendMessage, ); chatRouter.post( "/rooms/:roomId/messages/image", - // #swagger.tags = ['chat'] + /* #swagger.tags = ['chat'] + #swagger.requestBody = { + required: true, + content: { + 'image/jpg': { + schema: { type: 'string', format: 'binary' } + } + } + } */ validateChatImageUpload, chatController.sendMessage, ); chatRouter.post( "/rooms/:roomId/typing", - // #swagger.tags = ['chat'] + /* #swagger.tags = ['chat'] + #swagger.requestBody = { + schema: { $ref: "#/components/schemas/SetIsTypingSchema" } + } */ validator( z.object({ params: z.object({ diff --git a/src/module/learner/learner.route.ts b/src/module/learner/learner.route.ts index 3f3b251..ba4bf5b 100644 --- a/src/module/learner/learner.route.ts +++ b/src/module/learner/learner.route.ts @@ -24,21 +24,35 @@ learnerRouter.get( learnerRouter.patch( "/profile", - // #swagger.tags = ['learners'] + /* #swagger.tags = ['learners'] + #swagger.requestBody = { + schema: { $ref: "#/components/schemas/UpdateLearnerProfileSchema" } + } */ validator(updateProfileSchema), learnerController.updateProfile, ); learnerRouter.put( "/profile/picture", - // #swagger.tags = ['learners'] + /* #swagger.tags = ['learners'] + #swagger.requestBody = { + required: true, + content: { + 'image/jpg': { + schema: { type: 'string', format: 'binary' } + } + } + } */ validateProfilePictureUpload, learnerController.updateProfilePicture, ); learnerRouter.put( "/password", - // #swagger.tags = ['learners'] + /* #swagger.tags = ['learners'] + #swagger.requestBody = { + schema: { $ref: "#/components/schemas/ChangePasswordSchema" } + } */ validator(changePasswordSchema), learnerController.changePassword, ); diff --git a/src/module/order/order.route.ts b/src/module/order/order.route.ts index a44e3ff..86b8ec1 100644 --- a/src/module/order/order.route.ts +++ b/src/module/order/order.route.ts @@ -26,7 +26,10 @@ orderRouter.get( orderRouter.post( "/", - // #swagger.tags = ['orders'] + /* #swagger.tags = ['orders'] + #swagger.requestBody = { + schema: { $ref: "#/components/schemas/CreateOrderSchema" } + } */ verifyLearner, validator(createOrderSchema), orderController.createOrder, diff --git a/src/module/review/review.route.ts b/src/module/review/review.route.ts index 3d898a6..b2aa2ac 100644 --- a/src/module/review/review.route.ts +++ b/src/module/review/review.route.ts @@ -23,7 +23,10 @@ reviewRouter.use(verifyLearner); reviewRouter.post( "/orders/:orderId", - // #swagger.tags = ['reviews'] + /* #swagger.tags = ['reviews'] + #swagger.requestBody = { + schema: { $ref: "#/components/schemas/CreateReviewSchema" } + } */ validator(createReviewSchema), reviewController.createReview, ); diff --git a/src/module/tutor/tutor.route.ts b/src/module/tutor/tutor.route.ts index 33b88b8..b93985a 100644 --- a/src/module/tutor/tutor.route.ts +++ b/src/module/tutor/tutor.route.ts @@ -22,20 +22,34 @@ tutorRouter.get( tutorRouter.patch( "/profile", // #swagger.tags = ['tutors'] + /* #swagger.requestBody = { + schema: { $ref: "#/components/schemas/UpdateTutorProfileSchema" } + } */ validator(updateProfileSchema), tutorController.updateProfile, ); tutorRouter.put( "/profile/picture", - // #swagger.tags = ['tutors'] + /* #swagger.tags = ['tutors'] + #swagger.requestBody = { + required: true, + content: { + 'image/jpg': { + schema: { type: 'string', format: 'binary' } + } + } + } */ validateProfilePictureUpload, tutorController.updateProfilePicture, ); tutorRouter.put( "/password", - // #swagger.tags = ['tutors'] + /* #swagger.tags = ['tutors'] + #swagger.requestBody = { + schema: { $ref: "#/components/schemas/ChangePasswordSchema" } + } */ validator(changePasswordSchema), tutorController.changePassword, ); diff --git a/src/module/tutories/tutories.route.ts b/src/module/tutories/tutories.route.ts index bf81d67..d164be0 100644 --- a/src/module/tutories/tutories.route.ts +++ b/src/module/tutories/tutories.route.ts @@ -39,13 +39,19 @@ tutoriesRouter.get( tutoriesRouter.post( "/", - // #swagger.tags = ['tutors/services'] + /* #swagger.tags = ['tutors/services'] + #swagger.requestBody = { + schema: { $ref: "#/components/schemas/CreateTutoriesSchema" } + } */ validator(createTutoriesSchema), tutoriesController.createTutories, ); tutoriesRouter.patch( "/:tutoriesId", - // #swagger.tags = ['tutors/services'] + /* #swagger.tags = ['tutors/services'] + #swagger.requestBody = { + schema: { $ref: "#/components/schemas/UpdateTutoriesSchema" } + } */ validator(updateTutoriesSchema), tutoriesController.updateTutories, );