mirror of
https://github.com/vale981/grapher
synced 2025-03-05 09:31:42 -05:00
fix minor bug with Collection.createQuery()
This commit is contained in:
parent
58864d4960
commit
c1716591a9
2 changed files with 7 additions and 3 deletions
|
@ -6,7 +6,7 @@ export default (...args) => {
|
|||
let name;
|
||||
let body;
|
||||
let rest;
|
||||
if (typeof args[0] == 'string') { //NamedQuery
|
||||
if (typeof args[0] === 'string') { //NamedQuery
|
||||
name = args[0];
|
||||
body = args[1];
|
||||
rest = args.slice(2)
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
import Query from './query.js';
|
||||
import NamedQuery from '../namedQuery/namedQuery.js';
|
||||
import NamedQueryStore from '../namedQuery/store.js';
|
||||
|
||||
_.extend(Mongo.Collection.prototype, {
|
||||
createQuery(...args) {
|
||||
if (args[0] == 'string') { //NamedQuery
|
||||
if (typeof args[0] === 'string') {
|
||||
//NamedQuery
|
||||
const name = args[0];
|
||||
const body = args[1];
|
||||
const params = args[2];
|
||||
|
@ -11,7 +14,8 @@ _.extend(Mongo.Collection.prototype, {
|
|||
NamedQueryStore.add(name, query);
|
||||
|
||||
return query;
|
||||
} else { //Query
|
||||
} else {
|
||||
//Query
|
||||
const body = args[0];
|
||||
const params = args[1];
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue