sync fixes etc., push/pull sync is now working in basic form

This commit is contained in:
azivner
2017-10-26 23:21:31 -04:00
parent 297da47b34
commit a2f0a372a5
6 changed files with 38 additions and 17 deletions

View File

@@ -10,11 +10,14 @@ router.get('/:full_load_time', auth.checkApiAuth, async (req, res, next) => {
const browserId = req.get('x-browser-id');
const count = await sql.getSingleResult("SELECT COUNT(*) AS 'count' FROM audit_log WHERE browser_id != ? " +
"AND date_modified >= ?", [browserId, fullLoadTime])['count'];
const row = await sql.getSingleResult("SELECT COUNT(*) AS 'count' FROM audit_log WHERE (browser_id IS NULL OR browser_id != ?) " +
"AND date_modified >= ?", [browserId, fullLoadTime]);
console.log("SELECT COUNT(*) AS 'count' FROM audit_log WHERE (browser_id IS NULL OR browser_id != ?) " +
"AND date_modified >= ?");
res.send({
'changed': count > 0
'changed': row.count > 0
});
});