tweak log update
This commit is contained in:
parent
26e1ae305e
commit
4425b21b3d
2 changed files with 6 additions and 4 deletions
|
|
@ -18,11 +18,11 @@ const NUM_RESULTS = 1000
|
|||
* @returns {date} Last timestamp
|
||||
*/
|
||||
function getLastSeen (deviceId) {
|
||||
const sql = `select timestamp from logs
|
||||
const sql = `select id, timestamp from logs
|
||||
where device_id=$1
|
||||
order by timestamp desc limit 1`
|
||||
return db.oneOrNone(sql, [deviceId])
|
||||
.then(log => log ? log.timestamp : null)
|
||||
.then(log => log ? {timestamp: log.timestamp, id: log.id} : null)
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue