|
|
@@ -1,5 +1,5 @@
|
|
|
import type {
|
|
|
- IPageInfoForListing, IPageInfo,
|
|
|
+ IPageInfoForListing, IPageInfo, IPage,
|
|
|
} from '@growi/core';
|
|
|
import { getIdForRef, isIPageInfoForEntity } from '@growi/core';
|
|
|
import { ErrorV3 } from '@growi/core/dist/models';
|
|
|
@@ -8,7 +8,6 @@ import express from 'express';
|
|
|
import { query, oneOf } from 'express-validator';
|
|
|
import mongoose from 'mongoose';
|
|
|
|
|
|
-
|
|
|
import type { IPageGrantService } from '~/server/service/page-grant';
|
|
|
import loggerFactory from '~/utils/logger';
|
|
|
|
|
|
@@ -65,7 +64,7 @@ const routerFactory = (crowi: Crowi): Router => {
|
|
|
|
|
|
|
|
|
router.get('/root', accessTokenParser, loginRequired, async(req: AuthorizedRequest, res: ApiV3Response) => {
|
|
|
- const Page: PageModel = crowi.model('Page');
|
|
|
+ const Page = mongoose.model<IPage, PageModel>('Page');
|
|
|
|
|
|
let rootPage;
|
|
|
try {
|
|
|
@@ -122,9 +121,9 @@ const routerFactory = (crowi: Crowi): Router => {
|
|
|
const attachBookmarkCount: boolean = attachBookmarkCountParam === 'true';
|
|
|
const attachShortBody: boolean = attachShortBodyParam === 'true';
|
|
|
|
|
|
- const Page = mongoose.model('Page') as unknown as PageModel;
|
|
|
- const Bookmark = crowi.model('Bookmark');
|
|
|
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
|
+ const Page = mongoose.model<IPage, PageModel>('Page');
|
|
|
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
|
+ const Bookmark = mongoose.model<any, any>('Bookmark');
|
|
|
const pageService = crowi.pageService;
|
|
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
|
const pageGrantService: IPageGrantService = crowi.pageGrantService!;
|