godaddy / godaddy/datastar

Wrong Schema.prototype.sufficientRemoveConditions function

Open
#18 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
41
Forks
9
PR merge metrics
No merged PRs in 30d

Description

If 'key' is 0, for example
uid: cql.int()
and we try to remove uid = 0
like User.remove({uid: 0});
we get a false error in the function
```
Schema.prototype.sufficientRemoveConditions = function (conditions) {
var keys = this.lookups
? Object.keys(this.lookupTables).concat(this.primaryKeys())
: this.primaryKeys();

return keys.every(function (key) {
return !!conditions[key];
});
};
```
"Must pass in all primary keys when using lookup tables"

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.