philhawksworth / netlify-plugin-form-submissions

Fetch all submissions made to Netlify Forms in your site and stash them as JSON files before your build runs making the data available to your static site generator at build time.
MIT License
2 stars 1 forks source link

The API response is not always an array #2

Open ehmicky opened 4 years ago

ehmicky commented 4 years ago

In the following build, the API response is valid JSON, but is not an array. This results in the following line to crash:

https://github.com/philhawksworth/netlify-plugin-form-submissions/blob/edf92e437f25503ac28e2483c1f4705d29b3efbe/index.js#L38

With:

TypeError: forms.forEach is not a function
philhawksworth commented 4 years ago

Ack! Good catch. I add a fix for that.

philhawksworth commented 4 years ago

@ehmicky I'm curious to know when the API response is not an array. My tests show this API responds with an array of 0-N items.

I don't seem to have access to view that build in Humio. Can you help me with that?

ehmicky commented 4 years ago

(Helped directly from Slack)