Modifying plugin-cloud-storage's handleUpload

default discord avatar
Domosaurus
5 months ago
2

Hi, is it possible to modify

plugin-cloud-storage

's

handleUpload

function like how I can modify the

generateFileURL

function, ex:



plugins: [
  cloudStorage({
    collections: {
      media: { adapter: <adapter>, generateFileURL: generateFileURL,              handleUpload: <modify_here> } 
    }
  })
]


I can see in the docs that

generateFileURL

is exposed to be overwritten, I was wondering if

handleUpload

could also be overwritten



oop found it, ended up doing something like this:


plugins: [
  cloudStorage({
    collections: {
      media: { adapter: () => ({ ...{}, handleUpload }), generateFileURL: generateFileURL } 
    }
  })
]
    Open the post
    Continue the discussion in Discord
    Like what we're doing?
    Star us on GitHub!

    Star

    Connect with the Payload Community on Discord

    Discord

    online

    Can't find what you're looking for?

    Get help straight from the Payload team with an Enterprise License.