|
@@ -40,10 +40,17 @@ const router = express.Router();
|
|
|
* description: date created at
|
|
* description: date created at
|
|
|
* example: 2010-01-01T00:00:00.000Z
|
|
* example: 2010-01-01T00:00:00.000Z
|
|
|
* page:
|
|
* page:
|
|
|
- * $ref: '#/components/schemas/Page/properties/_id'
|
|
|
|
|
|
|
+ * $ref: '#/components/schemas/Page'
|
|
|
* user:
|
|
* user:
|
|
|
* $ref: '#/components/schemas/User/properties/_id'
|
|
* $ref: '#/components/schemas/User/properties/_id'
|
|
|
- *
|
|
|
|
|
|
|
+ * Bookmarks:
|
|
|
|
|
+ * description: User Root Bookmarks
|
|
|
|
|
+ * type: object
|
|
|
|
|
+ * properties:
|
|
|
|
|
+ * userRootBookmarks:
|
|
|
|
|
+ * type: array
|
|
|
|
|
+ * items:
|
|
|
|
|
+ * $ref: '#/components/schemas/Bookmark'
|
|
|
* BookmarkParams:
|
|
* BookmarkParams:
|
|
|
* description: BookmarkParams
|
|
* description: BookmarkParams
|
|
|
* type: object
|
|
* type: object
|
|
@@ -66,6 +73,14 @@ const router = express.Router();
|
|
|
* isBookmarked:
|
|
* isBookmarked:
|
|
|
* type: boolean
|
|
* type: boolean
|
|
|
* description: Whether the request user bookmarked (will be returned if the user is included in the request)
|
|
* 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'
|
|
|
*/
|
|
*/
|
|
|
/** @param {import('~/server/crowi').default} crowi Crowi instance */
|
|
/** @param {import('~/server/crowi').default} crowi Crowi instance */
|
|
|
module.exports = (crowi) => {
|
|
module.exports = (crowi) => {
|
|
@@ -165,28 +180,13 @@ module.exports = (crowi) => {
|
|
|
* description: user id
|
|
* description: user id
|
|
|
* schema:
|
|
* schema:
|
|
|
* type: string
|
|
* 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:
|
|
* responses:
|
|
|
* 200:
|
|
* 200:
|
|
|
* description: Succeeded to get my bookmarked status.
|
|
* description: Succeeded to get my bookmarked status.
|
|
|
* content:
|
|
* content:
|
|
|
* application/json:
|
|
* application/json:
|
|
|
* schema:
|
|
* schema:
|
|
|
- * $ref: '#/components/schemas/Bookmark'
|
|
|
|
|
|
|
+ * $ref: '#/components/schemas/Bookmarks'
|
|
|
*/
|
|
*/
|
|
|
validator.userBookmarkList = [
|
|
validator.userBookmarkList = [
|
|
|
param('userId').isMongoId().withMessage('userId is required'),
|
|
param('userId').isMongoId().withMessage('userId is required'),
|
|
@@ -244,7 +244,10 @@ module.exports = (crowi) => {
|
|
|
* content:
|
|
* content:
|
|
|
* application/json:
|
|
* application/json:
|
|
|
* schema:
|
|
* schema:
|
|
|
- * $ref: '#/components/schemas/Bookmark'
|
|
|
|
|
|
|
+ * type: object
|
|
|
|
|
+ * properties:
|
|
|
|
|
+ * bookmark:
|
|
|
|
|
+ * $ref: '#/components/schemas/Bookmark'
|
|
|
*/
|
|
*/
|
|
|
router.put('/', accessTokenParser, loginRequiredStrictly, addActivity, validator.bookmarks, apiV3FormValidator, async(req, res) => {
|
|
router.put('/', accessTokenParser, loginRequiredStrictly, addActivity, validator.bookmarks, apiV3FormValidator, async(req, res) => {
|
|
|
const { pageId, bool } = req.body;
|
|
const { pageId, bool } = req.body;
|