Skip to content

Commit

Permalink
Validate where/or/and statement by checking also $prepared (#167)
Browse files Browse the repository at this point in the history
* Validate where/or/and statement by checking also $prepared

* 2.6.57

* revert where statement
  • Loading branch information
anthioikonomou authored Oct 15, 2024
1 parent 65924d4 commit 632814b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions data-queryable.js
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,7 @@ DataQueryable.prototype.join = function(model)
});
*/
DataQueryable.prototype.and = function(attr) {
Args.check(this.query.$where != null, new Error('The where expression has not been initialized.'));
Args.check(this.query.$where != null || this.query.$prepared!=null , new Error('The where expression has not been initialized.'));
if (typeof attr === 'string' && /\//.test(attr)) {
this.query.and(DataAttributeResolver.prototype.resolveNestedAttribute.call(this, attr));
return this;
Expand All @@ -1017,7 +1017,7 @@ DataQueryable.prototype.and = function(attr) {
});
*/
DataQueryable.prototype.or = function(attr) {
Args.check(this.query.$where != null, new Error('The where expression has not been initialized.'));
Args.check(this.query.$where != null || this.query.$prepared!=null, new Error('The where expression has not been initialized.'));
if (typeof attr === 'string' && /\//.test(attr)) {
this.query.or(DataAttributeResolver.prototype.resolveNestedAttribute.call(this, attr));
return this;
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@themost/data",
"version": "2.6.56",
"version": "2.6.57",
"description": "MOST Web Framework Codename Blueshift - Data module",
"main": "index.js",
"types": "index.d.ts",
Expand Down

0 comments on commit 632814b

Please sign in to comment.