Skip to content

Commit

Permalink
fix: empty 1:1 relationships are not returned in correct format (#521)
Browse files Browse the repository at this point in the history
* fix: empty 1:1 relationships are not returned in correct format

* fix: failing unit test
  • Loading branch information
zacharygolba authored Nov 12, 2016
1 parent 6919517 commit 8cca55e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/packages/serializer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,9 @@ class Serializer<T: Model> {
});
}

return null;
return {
data: null
};
})()
}), {})
);
Expand Down
4 changes: 3 additions & 1 deletion src/packages/serializer/test/serializer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,9 @@ describe('module "serializer"', () => {
}
});
} else {
expect(relationships.image).to.be.null;
expect(relationships.image).to.deep.equal({
data: null
});
}

expect(relationships)
Expand Down

0 comments on commit 8cca55e

Please sign in to comment.