|
|
@@ -8,8 +8,11 @@ import { attachTitleHeader, normalizePath } from '@growi/core/dist/utils/path-ut
|
|
|
import type { Request, RequestHandler } from 'express';
|
|
|
import type { ValidationChain } from 'express-validator';
|
|
|
import { body } from 'express-validator';
|
|
|
+import i18next from 'i18next';
|
|
|
import mongoose from 'mongoose';
|
|
|
|
|
|
+// import { i18n } from '^/config/next-i18next.config';
|
|
|
+
|
|
|
import { SupportedAction, SupportedTargetModel } from '~/interfaces/activity';
|
|
|
import type { IApiv3PageCreateParams } from '~/interfaces/apiv3';
|
|
|
import { subscribeRuleNames } from '~/interfaces/in-app-notification';
|
|
|
@@ -46,6 +49,10 @@ async function determinePath(_parentPath?: string, _path?: string, optionalParen
|
|
|
// TODO: i18n
|
|
|
const basePathname = 'Untitled';
|
|
|
|
|
|
+ // const test = i18next.t('page_register.form_help.email');
|
|
|
+
|
|
|
+ // console.log(test);
|
|
|
+
|
|
|
if (_path != null) {
|
|
|
const path = normalizePath(_path);
|
|
|
|
|
|
@@ -90,6 +97,7 @@ type ReqBody = IApiv3PageCreateParams
|
|
|
|
|
|
interface CreatePageRequest extends Request<undefined, ApiV3Response, ReqBody> {
|
|
|
user: IUserHasId,
|
|
|
+ t,
|
|
|
}
|
|
|
|
|
|
type CreatePageHandlersFactory = (crowi: Crowi) => RequestHandler[];
|
|
|
@@ -208,6 +216,10 @@ export const createPageHandlersFactory: CreatePageHandlersFactory = (crowi) => {
|
|
|
body: bodyByParam, pageTags: tagsByParam,
|
|
|
} = req.body;
|
|
|
|
|
|
+ const basePathname = req.t('message.user_id_is_not_available');
|
|
|
+
|
|
|
+ console.log(basePathname);
|
|
|
+
|
|
|
let pathToCreate: string;
|
|
|
try {
|
|
|
const { path, parentPath, optionalParentPath } = req.body;
|