Open Scyks opened 11 months ago
PRs for minor bugs/improvements are always welcomed :)
However, please keep in mind the local file plugin is not recommended for production. It is meant for development only. The files are stored locally in a folder in your project, so you can delete the content of this folder if you want them gone.
Will label this as wontfix
, as we won't be solving this ourselves.
That's fine - but it makes sense to have the file removed, when the product which had those images are removed via admin. Deleting a product shall get the files cleanup from the local too.
For now, it's okay - but It would be helpful, and I will try to put a fix for the same here.
Bug report
Describe the bug
Seems like deletion of files using the medusa-file-local plugin doesn't work. Currently extending my backend using files to upload. Ofc course they need to be deleted as well. The call using https://docs.medusajs.com/api/admin#uploads_deleteuploads goes through and reports the file as deleted.
Never the less, the file still exists.
Quickly checked the plugin and found out that the api accepts
file_key
and passes this key to the fileService. Sadly the fileService usesfileKey
to delete the file.System information
Medusa version (including plugins):
Node.js version: 18.12.1 Database: postgres Operating system: MacOs Browser (if relevant): Chrome
Steps to reproduce the behavior
Expected behavior
File should be deleted
Possible Fix