Enable a collection's adminThumbnail
to execute regardless of MIME type
#3063
sannajammeh
started this conversation in
Feature Requests & Ideas
Replies: 1 comment 1 reply
-
Hey @sannajammeh — I see what you're going for here. I would happily merge a PR to make this function work as intended. Here's the code that would need to be modified (I think this is the one spot that would need attention). If a dev provides a function to the It would be pretty simple and painless I think! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The
adminThumbnail
property has two states, string or function. As it currently stands, Payload will refuse to execute theadminThumbnail
method on the frontend if the uploaded content is not of animage/*
mime type. This is counterintuitive.Use cases for enabling
Current Workaround:
This function can execute regardless of mime type, payload does not do it. If you swap the mime type of a video inside MongoDB from
video/mp4
toimage/jpeg
the function will execute.The final MongoDB document of a video would look like this
Example
This example utilises Bunny CDN's own thumbnail generator. Again this WORKS if you swap the mime type of the MongoDB document.
Beta Was this translation helpful? Give feedback.
All reactions