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

fix IPagePopulatedToShowRevision type error

Futa Arai 2 лет назад
Родитель
Сommit
257b27009c

+ 8 - 1
apps/app/src/client/services/side-effects/drawio-modal-launcher-for-view.ts

@@ -44,11 +44,18 @@ export const useDrawioModalLauncherForView = (opts?: {
     const currentMarkdown = currentPage.revision.body;
     const newMarkdown = mdu.replaceDrawioInMarkdown(drawioMxFile, currentMarkdown, bol, eol);
 
+    const grantUserGroupIds = currentPage.grantedGroups?.map((g) => {
+      return {
+        type: g.type,
+        item: g.item._id,
+      };
+    });
+
     const optionsToSave: OptionsToSave = {
       isSlackEnabled: false,
       slackChannels: '',
       grant: currentPage.grant,
-      grantUserGroupIds: currentPage.grantedGroups,
+      grantUserGroupIds,
       pageTags: tagsInfo.tags,
     };
 

+ 8 - 1
apps/app/src/client/services/side-effects/handsontable-modal-launcher-for-view.ts

@@ -43,11 +43,18 @@ export const useHandsontableModalLauncherForView = (opts?: {
     const currentMarkdown = currentPage.revision.body;
     const newMarkdown = mtu.replaceMarkdownTableInMarkdown(table, currentMarkdown, bol, eol);
 
+    const grantUserGroupIds = currentPage.grantedGroups?.map((g) => {
+      return {
+        type: g.type,
+        item: g.item._id,
+      };
+    });
+
     const optionsToSave: OptionsToSave = {
       isSlackEnabled: false,
       slackChannels: '',
       grant: currentPage.grant,
-      grantUserGroupIds: currentPage.grantedGroups,
+      grantUserGroupIds,
       pageTags: tagsInfo.tags,
     };
 

+ 1 - 1
packages/core/src/interfaces/page.ts

@@ -52,7 +52,7 @@ export type IPagePopulatedToShowRevision = Omit<IPageHasId, 'lastUpdateUser'|'cr
   lastUpdateUser: IUserHasId,
   creator: IUserHasId | null,
   deleteUser: IUserHasId,
-  grantedGroups: { type: string, item: IUserGroupHasId }[],
+  grantedGroups: { type: GroupType, item: IUserGroupHasId }[],
   revision: IRevisionHasId,
   author: IUserHasId,
 }