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

fix type for IAttachmentService

Yuki Takei 4 месяцев назад
Родитель
Сommit
667baccfad
1 измененных файлов с 3 добавлено и 3 удалено
  1. 3 3
      apps/app/src/server/service/attachment.ts

+ 3 - 3
apps/app/src/server/service/attachment.ts

@@ -1,4 +1,4 @@
-import type { Ref } from '@growi/core/dist/interfaces';
+import type { IAttachment, Ref } from '@growi/core/dist/interfaces';
 import type { HydratedDocument } from 'mongoose';
 import type { HydratedDocument } from 'mongoose';
 
 
 import loggerFactory from '~/utils/logger';
 import loggerFactory from '~/utils/logger';
@@ -32,7 +32,7 @@ type IAttachmentService = {
     disposeTmpFileCallback?: (file: Express.Multer.File) => void,
     disposeTmpFileCallback?: (file: Express.Multer.File) => void,
   ): Promise<IAttachmentDocument>;
   ): Promise<IAttachmentDocument>;
   removeAllAttachments(attachments: IAttachmentDocument[]): Promise<void>;
   removeAllAttachments(attachments: IAttachmentDocument[]): Promise<void>;
-  removeAttachment(attachmentId: Ref<IAttachmentDocument> | undefined): Promise<void>;
+  removeAttachment(attachmentId: Ref<IAttachment> | undefined): Promise<void>;
   isBrandLogoExist(): Promise<boolean>;
   isBrandLogoExist(): Promise<boolean>;
   addAttachHandler(handler: AttachHandler): void;
   addAttachHandler(handler: AttachHandler): void;
   addDetachHandler(handler: DetachHandler): void;
   addDetachHandler(handler: DetachHandler): void;
@@ -116,7 +116,7 @@ export class AttachmentService implements IAttachmentService {
     return;
     return;
   }
   }
 
 
-  async removeAttachment(attachmentId: Ref<IAttachmentDocument> | undefined): Promise<void> {
+  async removeAttachment(attachmentId: Ref<IAttachment> | undefined): Promise<void> {
     const { fileUploadService } = this.crowi;
     const { fileUploadService } = this.crowi;
     const attachment = await Attachment.findById(attachmentId);
     const attachment = await Attachment.findById(attachmentId);