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

refactor IDataAttachmentList type

Yuki Takei 3 лет назад
Родитель
Сommit
0c7145b1bd

+ 2 - 2
packages/app/src/interfaces/attachment.ts

@@ -1,10 +1,10 @@
-import type { IAttachment } from '@growi/core';
+import type { HasObjectId, IAttachment } from '@growi/core';
 
 import type { PaginateResult } from './mongoose-utils';
 
 
 export type IResAttachmentList = {
   data: {
-    paginateResult: PaginateResult<IAttachment>
+    paginateResult: PaginateResult<IAttachment & HasObjectId>
   }
 };

+ 2 - 1
packages/app/src/stores/attachment.tsx

@@ -1,6 +1,7 @@
 import { useCallback } from 'react';
 
 import {
+  HasObjectId,
   IAttachment, Nullable, SWRResponseWithUtils, withUtils,
 } from '@growi/core';
 import useSWR from 'swr';
@@ -13,7 +14,7 @@ type Util = {
 };
 
 type IDataAttachmentList = {
-  attachments: IAttachment[]
+  attachments: (IAttachment & HasObjectId)[]
   totalAttachments: number
   limit: number
 };