From 426b12c4767fdac75c65c48b05a7e86df166d857 Mon Sep 17 00:00:00 2001 From: Flummi Date: Sat, 14 Jan 2017 21:10:45 +0100 Subject: [PATCH] first --- src/websrv.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/websrv.js b/src/websrv.js index 7839ee8..3567df6 100644 --- a/src/websrv.js +++ b/src/websrv.js @@ -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) => { var items = { "items": [], - "latest": stamp + "first": stamp, + "latest": 0 }; rows.forEach(e => { items.items.push({ id: e.id, mime: e.mime }); - items.latest = e.id; + items.latest = e.stamp; }); res.writeHead(200, { 'Content-Type': 'text/html' }); res.end(JSON.stringify(items), 'utf-8'); @@ -338,4 +339,4 @@ Websrv.prototype.getTpls = () => { "how": fs.readFileSync("./s/how.tpl.html", "utf-8"), "contact": fs.readFileSync("./s/contact.tpl.html", "utf-8") }; -}; \ No newline at end of file +};