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

support(jsdoc): Add document to bookmark.js. #9451

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
41 changes: 22 additions & 19 deletions apps/app/src/server/routes/apiv3/bookmarks.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,17 @@ const router = express.Router();
* description: date created at
* example: 2010-01-01T00:00:00.000Z
* page:
* $ref: '#/components/schemas/Page/properties/_id'
* $ref: '#/components/schemas/Page'
* user:
* $ref: '#/components/schemas/User/properties/_id'
*
* Bookmarks:
* description: User Root Bookmarks
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

単に Bookmarks でいいのではないかと

* type: object
* properties:
* userRootBookmarks:
* type: array
* items:
* $ref: '#/components/schemas/Bookmark'
* BookmarkParams:
* description: BookmarkParams
* type: object
Expand All @@ -66,6 +73,14 @@ const router = express.Router();
* isBookmarked:
* type: boolean
* description: Whether the request user bookmarked (will be returned if the user is included in the request)
* pageId:
* type: string
* description: page ID
* example: 5e07345972560e001761fa63
* bookmarkedUsers:
* type: array
* items:
* $ref: '#/components/schemas/User'
*/

module.exports = (crowi) => {
Expand Down Expand Up @@ -165,28 +180,13 @@ module.exports = (crowi) => {
* description: user id
* schema:
* type: string
* - name: page
* in: query
* description: selected page number
* schema:
* type: number
* - name: limit
* in: query
* description: page item limit
* schema:
* type: number
* - name: offset
* in: query
* description: page item offset
* schema:
* type: number
* responses:
* 200:
* description: Succeeded to get my bookmarked status.
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/Bookmark'
* $ref: '#/components/schemas/Bookmarks'
*/
validator.userBookmarkList = [
param('userId').isMongoId().withMessage('userId is required'),
Expand Down Expand Up @@ -244,7 +244,10 @@ module.exports = (crowi) => {
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/Bookmark'
* type: object
* properties:
* bookmark:
* $ref: '#/components/schemas/Bookmark'
*/
router.put('/', accessTokenParser, loginRequiredStrictly, addActivity, validator.bookmarks, apiV3FormValidator, async(req, res) => {
const { pageId, bool } = req.body;
Expand Down
36 changes: 36 additions & 0 deletions apps/app/src/server/routes/apiv3/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,42 @@ const validator = {};
* type: string
* description: date created at
* example: 2010-01-01T00:00:00.000Z
* imageUrlCached:
* type: string
* description: cached image URL
* example: /images/user/5ae5fccfc5577b0004dbd8ab/profile.jpg
* isEmailPublished:
* type: boolean
* description: whether the email is published
* example: false
* isGravatarEnabled:
* type: boolean
* description: whether the gravatar is enabled
* example: false
* isInvitationEmailSended:
* type: boolean
* description: whether the invitation email is sent
* example: false
* isQuestionnaireEnabled:
* type: boolean
* description: whether the questionnaire is enabled
* example: false
* lastLoginAt:
* type: string
* description: datetime last login at
* example: 2010-01-01T00:00:00.000Z
* readOnly:
* type: boolean
* description: whether the user is read only
* example: false
* updatedAt:
* type: string
* description: datetime updated at
* example: 2010-01-01T00:00:00.000Z
* __v:
* type: integer
* description: DB record version
* example: 0
*/

module.exports = (crowi) => {
Expand Down
Loading