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

Use PageGrant type instead of number

Taichi Masuyama 3 лет назад
Родитель
Сommit
a3d2f82a93
2 измененных файлов с 3 добавлено и 3 удалено
  1. 1 1
      packages/app/src/interfaces/page.ts
  2. 2 2
      packages/app/src/stores/page.tsx

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

@@ -18,7 +18,7 @@ export interface IPage {
   parent: Ref<IPage> | null,
   parent: Ref<IPage> | null,
   descendantCount: number,
   descendantCount: number,
   isEmpty: boolean,
   isEmpty: boolean,
-  grant: number,
+  grant: PageGrant,
   grantedUsers: Ref<IUser>[],
   grantedUsers: Ref<IUser>[],
   grantedGroup: Ref<any>,
   grantedGroup: Ref<any>,
   lastUpdateUser: Ref<IUser>,
   lastUpdateUser: Ref<IUser>,

+ 2 - 2
packages/app/src/stores/page.tsx

@@ -5,7 +5,7 @@ import useSWRImmutable from 'swr/immutable';
 import { apiv3Get } from '~/client/util/apiv3-client';
 import { apiv3Get } from '~/client/util/apiv3-client';
 import { HasObjectId } from '~/interfaces/has-object-id';
 import { HasObjectId } from '~/interfaces/has-object-id';
 import {
 import {
-  IPageInfo, IPageHasId, IPageInfoForOperation, IPageInfoForListing, IDataWithMeta,
+  IPageInfo, IPageHasId, IPageInfoForOperation, IPageInfoForListing, IDataWithMeta, PageGrant,
 } from '~/interfaces/page';
 } from '~/interfaces/page';
 import { IPagingResult } from '~/interfaces/paging-result';
 import { IPagingResult } from '~/interfaces/paging-result';
 
 
@@ -162,7 +162,7 @@ export const useSWRxIsGrantNormalized = (
 };
 };
 
 
 export type IApplicableGrant = {
 export type IApplicableGrant = {
-  grant: number
+  grant: PageGrant
   applicableGroups?: {_id: string, name: string}[] // TODO: Typescriptize model
   applicableGroups?: {_id: string, name: string}[] // TODO: Typescriptize model
 }
 }
 export type IResApplicableGrant = {
 export type IResApplicableGrant = {