From 962780aeb1bd54c5658198b93ca7863222830f80 Mon Sep 17 00:00:00 2001 From: Roman Timashev Date: Fri, 2 Aug 2019 15:21:11 +0300 Subject: [PATCH] hardcoded page url --- pages/album/[album].js | 2 +- pages/article/[article].jsx | 2 +- pages/articles/[page].jsx | 2 +- pages/document/[document].jsx | 2 +- pages/documents.jsx | 2 +- pages/teacher/[person].jsx | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pages/album/[album].js b/pages/album/[album].js index a9a18ebe..79047b41 100644 --- a/pages/album/[album].js +++ b/pages/album/[album].js @@ -27,7 +27,7 @@ const Page = (props) => ( ) Page.getInitialProps = async (ctx) => { - const pageUrl = ctx.req.url + const pageUrl = '/gallery' const id = ctx.query.album const apiUrl = `http://localhost:3000/api/albums/${id}` const res = await axios.get(apiUrl) diff --git a/pages/article/[article].jsx b/pages/article/[article].jsx index 897f80f7..49756f63 100644 --- a/pages/article/[article].jsx +++ b/pages/article/[article].jsx @@ -28,7 +28,7 @@ const Page = (props) => ( ) Page.getInitialProps = async (ctx) => { - const pageUrl = ctx.req.url + const pageUrl = '/' const id = ctx.query.article const apiUrl = `http://localhost:3000/api/articles/${id}` const res = await axios.get(apiUrl) diff --git a/pages/articles/[page].jsx b/pages/articles/[page].jsx index 7cb685be..ce402ba2 100644 --- a/pages/articles/[page].jsx +++ b/pages/articles/[page].jsx @@ -32,7 +32,7 @@ const Page = (props) => ( ) Page.getInitialProps = async (ctx) => { - const pageUrl = ctx.req.url + const pageUrl = '/' const page = parseInt(ctx.query.page) const pageSize = 10 const apiUrl = `http://localhost:3000/api/articles?page=${page}&pageSize=${pageSize}` diff --git a/pages/document/[document].jsx b/pages/document/[document].jsx index bc53f65d..592753b1 100644 --- a/pages/document/[document].jsx +++ b/pages/document/[document].jsx @@ -20,7 +20,7 @@ const Page = (props) => ( ) Page.getInitialProps = async (ctx) => { - const pageUrl = ctx.req.url + const pageUrl = '/documents' const id = ctx.query.document const apiUrl = `http://localhost:3000/api/files/${id}` const res = await axios.get(apiUrl) diff --git a/pages/documents.jsx b/pages/documents.jsx index 80a79b0b..6271f4c0 100644 --- a/pages/documents.jsx +++ b/pages/documents.jsx @@ -119,7 +119,7 @@ const Page = (props) => ( ) Page.getInitialProps = async (ctx) => { - const pageUrl = ctx.req.url + const pageUrl = '/documents' const apiUrl = `http://localhost:3000/api/files` const res = await axios.get(apiUrl) const files = res.data.items diff --git a/pages/teacher/[person].jsx b/pages/teacher/[person].jsx index 3bf95cc5..f0461d8e 100644 --- a/pages/teacher/[person].jsx +++ b/pages/teacher/[person].jsx @@ -20,7 +20,7 @@ const Index = (props) => ( ) Index.getInitialProps = async (ctx) => { - const pageUrl = ctx.req.url + const pageUrl = '/collective' const id = ctx.query.person const apiUrl = `http://localhost:3000/api/persons/${id}` const res = await axios.get(apiUrl)