Skip to content

Commit

Permalink
fix: falsy IDs breaking relationships (#730)
Browse files Browse the repository at this point in the history
  • Loading branch information
nickschot authored and zacharygolba committed Jul 2, 2018
1 parent 667febd commit 56225da
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/packages/database/query/runner/utils/build-results.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export default async function buildResults<T: Model>({
.reduce((r, entry) => {
let [key, value] = entry;

if (!value && pkPattern.test(key)) {
if (value == null && pkPattern.test(key)) {
return r;
} else if (key.indexOf('.') >= 0) {
const [a, b] = key.split('.');
Expand Down
2 changes: 1 addition & 1 deletion src/packages/serializer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ class Serializer<T: Model> {
})
)
};
} else if (related && related.id) {
} else if (related && related.id != null) {
return this.formatRelationship({
domain,
included,
Expand Down

0 comments on commit 56225da

Please sign in to comment.