Welcome Guest, Not a member yet? Register   Sign In
Dynamic $allowedFields?
#1

(This post was last modified: 12-17-2020, 01:53 AM by blaasvaer.)

Hi,

I've created a dynamic API where the schema for the resource is built on the client based on DB field types (think Content Types in a headless cms). Now, all this dynamic breaks, because I 'have to' hard code the 'allowed_fields' property in the model (I'm actually passing them in from a config in the Controller, but anyway).

Now, are there ANY clever way – apart from passing the fields from the client as an array and somehow inject them into the Controller, and then pass them on to the Model, which is the only way I can see at the moment – to make this dynamic in a (built in/feature) way?

I'm thinking a way to 'override' or 'ignore' the $allowFields all together. As I understand from the docs, all fields NOT defined here will be ignored.
Reply


Messages In This Thread
Dynamic $allowedFields? - by blaasvaer - 12-17-2020, 01:50 AM
RE: Dynamic $allowedFields? - by paulbalandan - 12-17-2020, 08:53 AM
RE: Dynamic $allowedFields? - by blaasvaer - 12-17-2020, 09:40 AM
RE: Dynamic $allowedFields? - by tgix - 12-17-2020, 12:36 PM
RE: Dynamic $allowedFields? - by blaasvaer - 12-17-2020, 12:54 PM
RE: Dynamic $allowedFields? - by tgix - 12-17-2020, 01:34 PM
RE: Dynamic $allowedFields? - by InsiteFX - 12-17-2020, 10:01 PM



Theme © iAndrew 2016 - Forum software by © MyBB