ryoji-s 2 лет назад
Родитель
Сommit
a086ff14da
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      apps/app/src/server/service/page.ts

+ 2 - 2
apps/app/src/server/service/page.ts

@@ -2,7 +2,7 @@ import pathlib from 'path';
 import { Readable, Writable } from 'stream';
 import { Readable, Writable } from 'stream';
 
 
 import type {
 import type {
-  Ref, HasObjectId, IUserHasId,
+  Ref, HasObjectId, IUserHasId, IUser,
   IPage, IPageInfo, IPageInfoAll, IPageInfoForEntity, IPageWithMeta,
   IPage, IPageInfo, IPageInfoAll, IPageInfoForEntity, IPageWithMeta,
 } from '@growi/core';
 } from '@growi/core';
 import { PageGrant, PageStatus } from '@growi/core';
 import { PageGrant, PageStatus } from '@growi/core';
@@ -242,7 +242,7 @@ class PageService {
       return [];
       return [];
     }
     }
 
 
-    const User = mongoose.model('User');
+    const User = mongoose.model<IUser>('User');
     const usernames = userHomepages
     const usernames = userHomepages
       .map(page => getUsernameByPath(page.path))
       .map(page => getUsernameByPath(page.path))
       // see: https://zenn.dev/kimuson/articles/filter_safety_type_guard
       // see: https://zenn.dev/kimuson/articles/filter_safety_type_guard