Skip to content

Commit

Permalink
Merge pull request #240 from digitalsadhu/belongsTo-empty-response
Browse files Browse the repository at this point in the history
null response for empty BelongsTo relationship
  • Loading branch information
digitalsadhu authored Nov 18, 2017
2 parents 85323a4 + 483430f commit d3140d9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/serializer.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,8 @@ function parseRelations (data, relations, options) {
// No `data` key should be present unless there is actual relationship data.
if (relationship) {
relationships[name].data = relationship
} else if (relation.type === 'belongsTo') {
relationships[name].data = null
}
})

Expand Down

0 comments on commit d3140d9

Please sign in to comment.