diff options
Diffstat (limited to 'lib/db')
| -rw-r--r-- | lib/db/index.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/db/index.js b/lib/db/index.js index ffd8c27..6e36602 100644 --- a/lib/db/index.js +++ b/lib/db/index.js @@ -31,14 +31,14 @@ db.getRandom = function () { } db.getRandomAscii = function () { return ShaderImage.query(function(qb){ - qb.where("tag", "=", "ascii").orderBy(knex.raw('RAND()')).limit(1) + qb.where("tag", "ascii").orderBy(knex.raw('RAND()')).limit(1) }).fetch() } db.getIndex = function(limit, offset) { return Image.query(function(qb){ qb.orderBy("id", "desc").limit(limit) if (offset) qb.offset(offset) - }).fetch() + }).fetchAll() } db.createImage = function(url){ return new Image({ url: url }).save() |
