Просмотр исходного кода

refactor(suggest-path): add generics to mongoose.model for type safety

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
VANELLOPE\tomoyuki-t 1 месяц назад
Родитель
Сommit
6202d8ef48

+ 1 - 1
apps/app/src/features/suggest-path/server/services/resolve-parent-grant.ts

@@ -30,7 +30,7 @@ const findGrantInAncestors = async (
 };
 
 export const resolveParentGrant = async (dirPath: string): Promise<number> => {
-  const Page = mongoose.model('Page');
+  const Page = mongoose.model<PageWithGrant>('Page');
   const pagePath = pathUtils.removeTrailingSlash(dirPath);
 
   const grant = await findGrantInAncestors(Page, pagePath);