This commit is contained in:
Flummi 2017-01-14 21:10:45 +01:00
parent 1b8679b2ba
commit 426b12c476

View File

@ -254,14 +254,15 @@ function Websrv(tlib) {
lib.sql.query("select * from `f0ck`.`items` where `stamp` < ? order by `stamp` desc limit ?", [stamp, eps], (err, rows) => { lib.sql.query("select * from `f0ck`.`items` where `stamp` < ? order by `stamp` desc limit ?", [stamp, eps], (err, rows) => {
var items = { var items = {
"items": [], "items": [],
"latest": stamp "first": stamp,
"latest": 0
}; };
rows.forEach(e => { rows.forEach(e => {
items.items.push({ items.items.push({
id: e.id, id: e.id,
mime: e.mime mime: e.mime
}); });
items.latest = e.id; items.latest = e.stamp;
}); });
res.writeHead(200, { 'Content-Type': 'text/html' }); res.writeHead(200, { 'Content-Type': 'text/html' });
res.end(JSON.stringify(items), 'utf-8'); res.end(JSON.stringify(items), 'utf-8');