Skip to content
This repository was archived by the owner on Nov 28, 2017. It is now read-only.
This repository was archived by the owner on Nov 28, 2017. It is now read-only.

Allow initialization of relations via JSON array #44

Description

@joostverdoorn

We already allow singular relations to be initialized when they're passed from the backend in json, for example:

"fruit": {
  "id": 8,
  "brand": "Fuji",
  "basket": {
    "id": 4,
    "name": "Apple basket"
  }
}

This will create a basket and link the fruit and basket together. It would be nice to have it for plural relations as well:

"basket": {
  "id": 4,
  "name": "Apple basket",
  "fruits": [
    {
      "id": 8,
      "brand": "Fuji"
    },
    { 
      "id": 6,
      "brand": "Granny Smith"
    }
  ]
}

This should create two fruits and put them in the basket.

This shouldn't be too hard to build.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions