Skip to content

Fix the problem to set relationships to None/null.

This fixes the problem reported by @tobias.kuhnert on setting the end contact entry back to null / None. The allow_none attributes for the relationships needed to be added.

Setting it to null will require a payload like this:

{
  "data": {
    "type": "configuration_static_location_action",
    "attributes": {
      "x": 12.795639038085938,
      "y": 51.9493437994359,
      "z": null,
      "begin_description": "foo",
      "begin_date": "2022-08-21T06:10:00.000Z",
      "end_date": null,
      "end_description": null,
      "epsg_code": "4326",
      "elevation_datum_uri": "",
      "elevation_datum_name": "MSL"
    },
    "relationships": {
      "begin_contact": {
        "data": {
          "type": "contact",
          "id": "1"
        }
      },
      "configuration": {
        "data": {
          "type": "configuration",
          "id": "1"
        }
      },
      "end_contact": {
        "data": null
      }
    },
    "id": "2"
  }

So the end_contact is still in the relationships & it has an data entry. However instead of seting just the id field to null, we need to set the data to null (as a null value has no type).

Merge request reports