Skip to content

Commit

Permalink
fix: null response for empty BelongsTo relationship
Browse files Browse the repository at this point in the history
  • Loading branch information
alltouch authored and digitalsadhu committed Nov 18, 2017
1 parent 85323a4 commit 483430f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/serializer.js
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 483430f

Please sign in to comment.