|
@@ -10,9 +10,7 @@ const express = require('express');
|
|
|
const { body, query } = require('express-validator');
|
|
const { body, query } = require('express-validator');
|
|
|
|
|
|
|
|
const router = express.Router();
|
|
const router = express.Router();
|
|
|
-const {
|
|
|
|
|
- convertToNewAffiliationPath, isTopPage, isUserPage, isUserNamePage,
|
|
|
|
|
-} = pagePathUtils;
|
|
|
|
|
|
|
+const { convertToNewAffiliationPath } = pagePathUtils;
|
|
|
const ErrorV3 = require('../../models/vo/error-apiv3');
|
|
const ErrorV3 = require('../../models/vo/error-apiv3');
|
|
|
|
|
|
|
|
|
|
|
|
@@ -393,14 +391,12 @@ module.exports = (crowi) => {
|
|
|
|
|
|
|
|
const isBookmarked = await Bookmark.findByPageIdAndUserId(pageId, user._id);
|
|
const isBookmarked = await Bookmark.findByPageIdAndUserId(pageId, user._id);
|
|
|
const isLiked = page.isLiked(user);
|
|
const isLiked = page.isLiked(user);
|
|
|
- const isMovable = !isTopPage(page.path) && !isUserPage(page.path) && !isUserNamePage(page.path);
|
|
|
|
|
const isAbleToDeleteCompletely = pageService.canDeleteCompletely(page.creator?._id, user);
|
|
const isAbleToDeleteCompletely = pageService.canDeleteCompletely(page.creator?._id, user);
|
|
|
|
|
|
|
|
const subscription = await Subscription.findByUserIdAndTargetId(user._id, pageId);
|
|
const subscription = await Subscription.findByUserIdAndTargetId(user._id, pageId);
|
|
|
|
|
|
|
|
const responseBody = {
|
|
const responseBody = {
|
|
|
...responseBodyForGuest,
|
|
...responseBodyForGuest,
|
|
|
- isMovable,
|
|
|
|
|
isAbleToDeleteCompletely,
|
|
isAbleToDeleteCompletely,
|
|
|
isBookmarked,
|
|
isBookmarked,
|
|
|
isLiked,
|
|
isLiked,
|