You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've created an upload collection where I've set disableLocalStorage to true. I'm using the afterChange and afterDelete to send fetch requests to another service which handles storing and resizing the images for me.
I've decided to use the document's id as part of the URL to access the image on this third party service.
To display the image's thumbnail in Payload's admin UI, I'm wanted to use the adminThumbnail property in the collection config, to generate the URL to this third party service. However, this cannot be achieved because the id property is missing in the doc parameter of the adminThumbnail function (the type is GetAdminThumbnail["doc"]).
I'm not sure if this is a bug or a feature request.
I've made a quick and dirty patch (which doesn't seem to work when running the dev server, only when running build and serve): payload+2.18.3.patch.txt
To Reproduce
Create an upload collection
In the collection's config set the property upload.adminThumbnail to the following:
({ doc })=>{console.log(doc);returndoc.url;},
Now run the payload server, connect to it and create an entry in this collection.
In the dev console you should see the content of doc which seem to reflect the current state of the edit view but not the actual properties of the document:
Link to reproduction
No response
Describe the Bug
I've created an upload collection where I've set
disableLocalStorage
to true. I'm using theafterChange
andafterDelete
to send fetch requests to another service which handles storing and resizing the images for me.I've decided to use the document's
id
as part of the URL to access the image on this third party service.To display the image's thumbnail in Payload's admin UI, I'm wanted to use the
adminThumbnail
property in the collection config, to generate the URL to this third party service. However, this cannot be achieved because theid
property is missing in the doc parameter of theadminThumbnail
function (the type isGetAdminThumbnail["doc"]
).I'm not sure if this is a bug or a feature request.
I've made a quick and dirty patch (which doesn't seem to work when running the dev server, only when running build and serve):
payload+2.18.3.patch.txt
To Reproduce
doc
which seem to reflect the current state of the edit view but not the actual properties of the document:Payload Version
2.18.3
Adapters and Plugins
"@payloadcms/bundler-webpack": "1.0.6", "@payloadcms/db-mongodb": "1.5.1", "@payloadcms/richtext-lexical": "0.11.1", "payloadcms-sftp-storage": "1.0.1",
The text was updated successfully, but these errors were encountered: