BuildShipBBuildShip
Powered by
AbrarA
BuildShip•2y ago•
5 replies
Abrar

Validating the existence of query string parameters

So I'm relaying a call to an api which accepts a bunch of optional query params....

When i make the API call... I try to pass on the query params like so...

{
  "key" : (await getSecret("openaustralia-key")),
  "date" : ctx["root"]["request"]["query"].date,
  "party" : ctx["root"]["request"]["query"].party,
  "state" : ctx["root"]["request"]["query"].state,
  "search" : ctx["root"]["request"]["query"].search
}
{
  "key" : (await getSecret("openaustralia-key")),
  "date" : ctx["root"]["request"]["query"].date,
  "party" : ctx["root"]["request"]["query"].party,
  "state" : ctx["root"]["request"]["query"].state,
  "search" : ctx["root"]["request"]["query"].search
}


I'm looking for a simple in-line way to validate the existence of each param, and only then and only populate the value..

Does anyone know how to do this in a clean and efficient manner?

(NB: im not a javascript guru)
Thanks in advance
Solution
Alternately you can use the API call to pass multiple parameter at one to your API
image.png
Jump to solution
BuildShip banner
BuildShipJoin
Join founders, builders, devs using Low-code / No-code to create backend, APIs, scheduled Jobs, automation, AI workflows
7,971Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

whatsapp-trigger - >Error: error validating signature
Angel MayrAAngel Mayr / ❓・buildship-help
2y ago
whatsapp-trigger - >Error: error validating signature x2
Angel MayrAAngel Mayr / ❓・buildship-help
2y ago
query
AbrarAAbrar / ❓・buildship-help
2y ago
query
kumarkiranKkumarkiran / ❓・buildship-help
3y ago