Skip to content

Commit

Permalink
Fix conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
nolze committed Sep 16, 2020
1 parent 21f6884 commit c11048f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/src/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ async function getPage(pageid) {

async function getPageHistory(pageid, offset, limit) {
offset = offset || 0;
limit = limit && limit <= 50 ? limit : 10;
limit = !!limit && limit <= 50 ? limit : 10;
const rows = await knex
.select()
.from('pages_archive')
Expand All @@ -207,7 +207,7 @@ async function getPageHistory(pageid, offset, limit) {

async function search(q, offset, limit, order) {
offset = offset || 0;
limit = limit && limit <= 50 ? limit : 10;
limit = !!limit && limit <= 50 ? limit : 10;
order = order || 'updated';

let orderBy = ['timestamp', 'desc'];
Expand Down

0 comments on commit c11048f

Please sign in to comment.