|
@@ -23,9 +23,9 @@ const today = new Date();
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
module.exports = (crowi) => {
|
|
module.exports = (crowi) => {
|
|
|
- const loginRequired = require('../../middleware/login-required')(crowi);
|
|
|
|
|
- const csrf = require('../../middleware/csrf')(crowi);
|
|
|
|
|
- const { ApiV3FormValidator } = crowi.middlewares;
|
|
|
|
|
|
|
+ const loginRequired = require('../../middlewares/login-required')(crowi);
|
|
|
|
|
+ const csrf = require('../../middlewares/csrf')(crowi);
|
|
|
|
|
+ const apiV3FormValidator = require('../../middlewares/apiv3-form-validator')(crowi);
|
|
|
const ShareLink = crowi.model('ShareLink');
|
|
const ShareLink = crowi.model('ShareLink');
|
|
|
|
|
|
|
|
|
|
|
|
@@ -48,7 +48,7 @@ module.exports = (crowi) => {
|
|
|
* 200:
|
|
* 200:
|
|
|
* description: Succeeded to get share links
|
|
* description: Succeeded to get share links
|
|
|
*/
|
|
*/
|
|
|
- router.get('/', loginRequired, csrf, ApiV3FormValidator, async(req, res) => {
|
|
|
|
|
|
|
+ router.get('/', loginRequired, csrf, apiV3FormValidator, async(req, res) => {
|
|
|
const { relatedPage } = req.query;
|
|
const { relatedPage } = req.query;
|
|
|
try {
|
|
try {
|
|
|
const shareLinksResult = await ShareLink.find({ relatedPage: { $in: relatedPage } });
|
|
const shareLinksResult = await ShareLink.find({ relatedPage: { $in: relatedPage } });
|
|
@@ -100,7 +100,7 @@ module.exports = (crowi) => {
|
|
|
* description: Succeeded to create one share link
|
|
* description: Succeeded to create one share link
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
- router.post('/', loginRequired, csrf, validator.shareLinkStatus, ApiV3FormValidator, async(req, res) => {
|
|
|
|
|
|
|
+ router.post('/', loginRequired, csrf, validator.shareLinkStatus, apiV3FormValidator, async(req, res) => {
|
|
|
const { relatedPage, expiredAt, description } = req.body;
|
|
const { relatedPage, expiredAt, description } = req.body;
|
|
|
const ShareLink = crowi.model('ShareLink');
|
|
const ShareLink = crowi.model('ShareLink');
|
|
|
|
|
|