Ensure notifications are sorted by time descending

This commit is contained in:
Johannes Zellner
2019-05-13 22:05:58 +02:00
parent 05dd65718f
commit 63310c44c0
2 changed files with 13 additions and 10 deletions

View File

@@ -112,7 +112,7 @@ function listByUserIdPaged(userId, page, perPage, callback) {
var data = [ userId ];
var query = 'SELECT ' + NOTIFICATION_FIELDS + ' FROM notifications WHERE userId=?';
query += ' ORDER BY creationTime, title DESC LIMIT ?,?';
query += ' ORDER BY creationTime DESC LIMIT ?,?';
data.push((page-1)*perPage);
data.push(perPage);