fix(media): update S3 file info type casting for stricter type safety

Replace `any` with `BucketItemStat` for `getFileInfo` response in MediaController to ensure accurate type definition.
This commit is contained in:
Mathis HERRIOT
2026-01-20 09:57:38 +01:00
parent 8b2728dc5a
commit 28caf92f9a

View File

@@ -1,5 +1,6 @@
import { Controller, Get, NotFoundException, Param, Res } from "@nestjs/common";
import type { Response } from "express";
import type { BucketItemStat } from "minio";
import { S3Service } from "../s3/s3.service";
@Controller("media")
@@ -9,7 +10,7 @@ export class MediaController {
@Get("*key")
async getFile(@Param("key") key: string, @Res() res: Response) {
try {
const stats = (await this.s3Service.getFileInfo(key)) as any;
const stats = (await this.s3Service.getFileInfo(key)) as BucketItemStat;
const stream = await this.s3Service.getFile(key);
const contentType =