diff options
author | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2019-10-12 16:54:05 +0200 |
---|---|---|
committer | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2019-10-12 16:54:05 +0200 |
commit | 5cfbd5b71d149419b0b80056e652ca94d26f1a95 (patch) | |
tree | 4f61dd2e8822cec3613c0ef7f17f694afc42182e /scripts/generateApi.js | |
parent | d92f1a2a1bac3039434a16c504cc1d54c6d0409a (diff) | |
download | puszcza-5cfbd5b71d149419b0b80056e652ca94d26f1a95.tar.gz puszcza-5cfbd5b71d149419b0b80056e652ca94d26f1a95.zip |
Move to single api
Diffstat (limited to 'scripts/generateApi.js')
-rwxr-xr-x | scripts/generateApi.js | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/scripts/generateApi.js b/scripts/generateApi.js index 27af063..128387c 100755 --- a/scripts/generateApi.js +++ b/scripts/generateApi.js @@ -4,16 +4,18 @@ let { getPosts } = require('../api/api') let posts = getPosts() -posts = posts.map(({ year, month, day, title, attributes, route }) => { - return { - date: `${year}-${month}-${day}`, - title, - attributes, - route - } +posts = posts.map(({ year, month, day, title, data, route }) => { + return { + date: `${year}-${month}-${day}`, + title, + data, + route + } }) posts.sort((a, b) => (a.route > b.route ? 1 : -1)) -fs.writeFile('./dist/api/posts.json', JSON.stringify(posts), (err) => err ? console.log(err) : null) +fs.writeFile('./dist/api/posts.json', JSON.stringify(posts), err => + err ? console.log(err) : null +) console.log(posts) |