Skip to content

Correct type for items in relationship#7

Merged
ColtonProvias merged 1 commit intoColtonProvias:masterfrom
angelosarto:patch-1
Sep 17, 2015
Merged

Correct type for items in relationship#7
ColtonProvias merged 1 commit intoColtonProvias:masterfrom
angelosarto:patch-1

Conversation

@angelosarto
Copy link
Copy Markdown
Contributor

In the current implementation it seems like the type of the related item is being set to the current item.
Should it instead be that the type field of related item type of the related item?
e.g. in this json response given an item object and a category object, when returning an item.

{
  "data": [
  {
  "attributes": {
    "name": "Item 1"
  },
  "id": 1,
  "relationships": {
    "category": {
      "data": [
        {
          "id": 1,
          "type": "item"   // <----------should be category
        }
      ]
    },
  "type": "item"
}]

Type field of related item in relationship should be type of the related item not the current type.
@ColtonProvias
Copy link
Copy Markdown
Owner

My bad. Thanks for catching my mistake!

ColtonProvias added a commit that referenced this pull request Sep 17, 2015
Correct type for items in relationship
@ColtonProvias ColtonProvias merged commit a71b2b8 into ColtonProvias:master Sep 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants