Răsfoiți Sursa

Merge pull request #9790 from goofmint/fix/doc-v3-user-activation

support(jsdoc): Add swagger document to user-activation.ts
Yuki Takei 1 an în urmă
părinte
comite
91e0d512b1

+ 40 - 0
apps/app/src/server/routes/apiv3/user-activation.ts

@@ -70,6 +70,46 @@ async function sendEmailToAllAdmins(userData, admins, appTitle, mailService, tem
   });
   });
 }
 }
 
 
+/**
+ * @swagger
+ *
+ * /complete-registration:
+ *   post:
+ *     summary: /complete-registration
+ *     tags: [Users]
+ *     security: []
+ *     operationId: completeRegistration
+ *     requestBody:
+ *       required: true
+ *       content:
+ *         application/json:
+ *           schema:
+ *             type: object
+ *             properties:
+ *               registerForm:
+ *                 type: object
+ *                 properties:
+ *                   username:
+ *                     type: string
+ *                   name:
+ *                     type: string
+ *                   password:
+ *                     type: string
+ *                   token:
+ *                     type: string
+ *                   email:
+ *                     type: string
+ *     responses:
+ *       200:
+ *         description: User activation successful
+ *         content:
+ *           application/json:
+ *             schema:
+ *               type: object
+ *               properties:
+ *                 redirectTo:
+ *                   type: string
+ */
 export const completeRegistrationAction = (crowi: Crowi) => {
 export const completeRegistrationAction = (crowi: Crowi) => {
   const User = mongoose.model<IUser, { isEmailValid, isRegisterable, createUserByEmailAndPassword, findAdmins }>('User');
   const User = mongoose.model<IUser, { isEmailValid, isRegisterable, createUserByEmailAndPassword, findAdmins }>('User');
   const activityEvent = crowi.event('activity');
   const activityEvent = crowi.event('activity');

+ 20 - 0
apps/app/src/server/routes/user-activation.ts

@@ -12,6 +12,26 @@ type CrowiReq = ReqWithUserRegistrationOrder & {
   crowi: Crowi,
   crowi: Crowi,
 }
 }
 
 
+/**
+ * @swagger
+ *
+ * /user-activation/:token:
+ *   get:
+ *     summary: /user-activation/:token
+ *     tags: [Users]
+ *     parameters:
+ *       - name: token
+ *         in: path
+ *         required: true
+ *         type: string
+ *     responses:
+ *       200:
+ *         description: User activation successful
+ *         content:
+ *           text/html:
+ *             schema:
+ *               type: string
+ */
 export const renderUserActivationPage = (crowi: Crowi) => {
 export const renderUserActivationPage = (crowi: Crowi) => {
   return (req: CrowiReq, res: Response): void => {
   return (req: CrowiReq, res: Response): void => {
     const { userRegistrationOrder } = req;
     const { userRegistrationOrder } = req;