Skip to content

PATCH returns data:[] relationships #318

Closed
@joshhubers

Description

@joshhubers

When I patch to an endpoint the relationship returns data: [], which isn't always true.
For example, if I had ingredients and recipes, I query for recipes?include=ingredients and I will get the included ingredients as expected.

However, if I PATCH to recipe, the relationship returns an empty array, even though relationships exist
For example:

{  
   "data":{  
      "attributes":{  
         "id":203,
         "title":"Cake",
      },
      "relationships":{  
         "ingredients":{  
            "links":{...},
            "data":[ ] <------- Shouldn't be empty or present?
         }
      },
      "type":"recipes",
      "id":"203"
   }
}

In my case I'm building an ember app, so ember thinks that the relationships just magically disappear and content on the page will disappear on update.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions