New IHP Case Study: How AirPV is making the process of going solar easier and better value with IHP

JSONB with fill

montmorency BUSINESS

I noticed that the IHP fill function gives a could not deduce (ParamReader Value) type error when trying to populate a record field with type JSONB. The application here is just looking to store the raw JSON payload from n AJAX request. I'm wondering what the best way to handle this would be?

Edit: Actually it looks like the ihp function requestBodyJSON is all that is required. This unpacks the JSON payload to an Aeson value and that could be stored in the jsonb record field .

marc PRO

requestBodyJSON is exactly the right thing :) fill generally works with JSON, but only when decoding to some specific value (e.g. fill @'["projectsCount"] would work with a request like {"projectsCount":1337})