#Adding Query Parameter to `payload.find` Call

13 messages ยท Page 1 of 1 (latest)

honest masonBOT
#

Hi ya'll ๐Ÿ‘‹๐Ÿผ

How would I go about adding a query parameter to my payload.find call? I would like to integrate &encodeSourceMaps=true.

indigo capeBOT
#

Original message from @frail forge - Moved from #general message

maiden sentinel
#

@frail forge Hmmm

#

To the find call on the local api?

#

I'm not sure how to do this via the local API find call

#

However..

#

You could create a custom endpoint on your collection, which could make the equivalent of a find operation with the additional params

#
try {
  const req = await fetch('{cms-url}/api/{collection-slug}?param=foo')
  const data = await req.json()
} catch (err) {
  console.log(err)
}
frail forge
#

Thank you @maiden sentinel for your reply. I'm aware of this option, was just hoping to find a more standard solution using the local API ๐Ÿ™‚

maiden sentinel
#

@frail forge Feel free to raise a feature request if you think this addition would be helpful!

#

(The team does review feature requests seriously)