summary refs log tree commit diff
path: root/lib/getPosts.ts
diff options
context:
space:
mode:
authorPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2020-01-28 18:16:03 +0100
committerGitHub <noreply@github.com>2020-01-28 18:16:03 +0100
commit42c089293fed2db9c8a09d8e55f046169b5f0844 (patch)
tree18a053fe7f1e03fc5419a8c3d2a8bc8193cb27f0 /lib/getPosts.ts
parent7b8d75cd87e392d9ffb3defa538a041c4f7e0f0c (diff)
parentacfd4d0c722ceeca6aad51be64baf117e73f286c (diff)
downloadkronikarz-42c089293fed2db9c8a09d8e55f046169b5f0844.tar.gz
kronikarz-42c089293fed2db9c8a09d8e55f046169b5f0844.zip
Merge pull request #8 from pniedzwiedzinski/feature/generateApi v2.0
Feature/generate api
Diffstat (limited to 'lib/getPosts.ts')
-rw-r--r--lib/getPosts.ts5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/getPosts.ts b/lib/getPosts.ts
index c363c67..814f6d8 100644
--- a/lib/getPosts.ts
+++ b/lib/getPosts.ts
@@ -1,5 +1,4 @@
-import { Post } from "./interfaces";
-import { parsePost } from "./parsePost";
+import Post from "./Post";
 import { readDir } from "./utils";
 
 function getPosts(path: string): Array<Post> {
@@ -14,7 +13,7 @@ function getPosts(path: string): Array<Post> {
         files.forEach((file: string) => {
           const fsRoute = `${path}/${year}/${month}/${day}/${file}`;
           try {
-            const post = parsePost(fsRoute);
+            const post = new Post(fsRoute);
             routesArray.push(post);
           } catch (err) {
             console.log(err);