colossal-harlequinC
Refine3y ago
11 replies
colossal-harlequin

Multiple select for nested objects with IDs

Hi everyone. I'm trying to build a Form.Item with a Select inside for multiple related objects.
My base objects look like this:
{
  "id": 1,
  "relations": [
    {
      "id": 1
    },
    {
      "id": 2
    }
  ]
}

So I want <Form.Item> to set an array of objects, not just numbers. It works just fine for “many-to-one” relation with NamePath (name={['relation', 'id']}), but when it comes to “one-to-many” relation NamePath won't help.

I was trying to play with normalize and other things, but with no luck.
Was this page helpful?