Problem with typing in upload configuration.
maximilianvb opened this issue · 2 comments
maximilianvb commented
Hi, I've been trying out Payload CMS and this plugin together. The typing does not work.
The CollectionConfig type built into Payload won't accept a field called s3, for example:
upload: {
staticURL: '/assets',
staticDir: 'assets',
disableLocalStorage: true,
s3: {
bucket: 'payloadcms-storage',
prefix: 'images', // files will be stored in bucket folder images
},
adminThumbnail: ({ doc }) =>
`https://payloadcms-storage.s3.eu-west-3.amazonaws.com/images/${doc.filename}`,
},
Not really sure what the workaround is here, maybe I missed something in how to use this plugin.
jeanbmar commented
Hello,
The module was intended for JavaScript initially, but I will make a change to type things since it requires little effort.
In the meantime, you can extend the CollectionConfig type in Payload in order to support this module fields.
See: https://github.com/jeanbmar/payload-s3-upload/pull/6/files
Cheers