diff options
author | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2021-01-10 11:46:08 +0100 |
---|---|---|
committer | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2021-01-10 11:46:08 +0100 |
commit | 62a31ccb588c45e6a6a53785e05f939eb41f4818 (patch) | |
tree | 9e194a800c3c2deed2896cafb0d4fb673dbdef39 | |
parent | 3bbeb33e6df1aac21ec2e92931f4628b992f4013 (diff) | |
download | kronikarz-62a31ccb588c45e6a6a53785e05f939eb41f4818.tar.gz kronikarz-62a31ccb588c45e6a6a53785e05f939eb41f4818.zip |
Fix parsing posts pages
-rw-r--r-- | lib/generateApi.ts | 4 | ||||
-rw-r--r-- | package.json | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/generateApi.ts b/lib/generateApi.ts index c8b20ce..3019d3c 100644 --- a/lib/generateApi.ts +++ b/lib/generateApi.ts @@ -77,12 +77,12 @@ function generateApiIndex(posts: Array<Post>, path: string) { * This function generates pages on path `/api/page/<number>` */ function generatePages(posts: Array<Post>, path: string, len: number = 8) { - const parsedPosts = posts.map(parsePosts); const pages = chunk(posts, len); mkDirByPathSync(`${path}/api/page`); pages.forEach((posts: Array<Post>, index: number) => { + const parsedPosts = posts.map(parsePosts); const pageNumber = index + 1; - const page = { posts, next : pageNumber + 1 }; + const page = { posts: parsedPosts, next : pageNumber + 1 }; if (pageNumber == pages.length) { delete page.next; } diff --git a/package.json b/package.json index 09d3705..a35aaea 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "kronikarz", - "version": "2.3.0", + "version": "2.3.1", "description": "System elektronicznej kroniki", "main": "dist/index.js", "types": "dist/index.d.ts", |