about summary refs log tree commit diff
path: root/components/Posts/PostList/parentMixin.js
diff options
context:
space:
mode:
authorPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2021-01-10 12:31:02 +0100
committerPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2021-01-10 12:31:02 +0100
commited9e80f161f6c99228595bc9dab9897469de224c (patch)
tree8b1bf8ffdce5f5d8e4f7f2d8ac49269dd3d4672a /components/Posts/PostList/parentMixin.js
parentebb089825a57c1fee04f8b2c0ea43447c07deeb6 (diff)
downloadpuszcza-ed9e80f161f6c99228595bc9dab9897469de224c.tar.gz
puszcza-ed9e80f161f6c99228595bc9dab9897469de224c.zip
Add pagination
Diffstat (limited to 'components/Posts/PostList/parentMixin.js')
-rw-r--r--components/Posts/PostList/parentMixin.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/components/Posts/PostList/parentMixin.js b/components/Posts/PostList/parentMixin.js
index 801d51c..b9181e8 100644
--- a/components/Posts/PostList/parentMixin.js
+++ b/components/Posts/PostList/parentMixin.js
@@ -1,9 +1,10 @@
 import { getPosts } from './index'
 
 export default {
-  async asyncData() {
-    return {
-      posts: await getPosts(),
-    }
+  async asyncData({ query }) {
+    let page = query.page || 1;
+    const data = await getPosts(page);
+    return data;
   },
+  watchQuery: true
 }