diff --git a/public/js/data/load.mjs b/public/js/data/load.mjs index a48f636..0663553 100644 --- a/public/js/data/load.mjs +++ b/public/js/data/load.mjs @@ -23,8 +23,8 @@ export const loadData = async function (_params) { promises.push(GET(stats)); promises.push( GET(pads) - .then(res => { - const [ data ] = res; + .then(data => { + // const [ data ] = res; data.forEach(d => d.source = `${origin}/en/view/pad?id=${d.pad_id}`); return data; }) diff --git a/routes/datasources.js b/routes/datasources.js index e2778bb..e15ddbb 100644 --- a/routes/datasources.js +++ b/routes/datasources.js @@ -46,8 +46,8 @@ exports.increase = (req, res) => { promises.push( fetch(pads) .then(response => response.json()) - .then(json => { - const [ data ] = json; + .then(data => { + // const [ data ] = json; data.forEach(d => d.source = `${origin}/en/view/pad?id=${d.pad_id}`); return data; }).catch(err => console.log(err)) diff --git a/routes/index.js b/routes/index.js index e1d7db1..d250089 100644 --- a/routes/index.js +++ b/routes/index.js @@ -11,11 +11,9 @@ exports.home = (req, res) => { batch.push(t.any(`SELECT * FROM notes;`)) batch.push(t.any(`SELECT * FROM titles;`)) return t.batch(batch) - }) - .then(data => { + }).then(data => { res.render('home', { title: 'post it', notes: JSON.stringify(data[0]), titles: JSON.stringify(data[1]) }) - }) - .catch(err => console.log(err)) + }).catch(err => console.log(err)) } exports.wall = (req, res) => { const { id: wallId } = req.params;