fix(medusa): unable to delete downloaded files (#6169)

resolve #6168
This commit is contained in:
invalid w
2024-02-22 20:13:42 +08:00
committed by GitHub
parent 52afc619b3
commit 58943e83fd

View File

@@ -1,5 +1,6 @@
import { IsString } from "class-validator"
import { Request, Response } from "express"
import { IFileService } from "../../../../interfaces"
/**
* @oas [delete] /admin/uploads
* operationId: "DeleteUploads"
@@ -83,12 +84,14 @@ import { IsString } from "class-validator"
* "500":
* $ref: "#/components/responses/500_error"
*/
export default async (req, res) => {
export default async (req: Request, res: Response) => {
const validated = req.validatedBody as AdminDeleteUploadsReq
const fileService = req.scope.resolve("fileService")
const fileService: IFileService = req.scope.resolve("fileService")
await fileService.delete(validated)
await fileService.delete({
fileKey: validated.file_key,
})
res
.status(200)