From 42c732a90da23248f2f8cbf553785d1f3fd0061a Mon Sep 17 00:00:00 2001 From: gbrochar Date: Wed, 2 Dec 2020 14:01:14 +0100 Subject: [PATCH] blog base functions fix --- src/client/Blog.tsx | 12 ++++++++---- src/server/routes/api.ts | 1 - 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/client/Blog.tsx b/src/client/Blog.tsx index c89d0b6..daec91e 100644 --- a/src/client/Blog.tsx +++ b/src/client/Blog.tsx @@ -34,13 +34,17 @@ export default function Blog() { tmpArticles.pop(); for (let i = 0; i < res.data.length; i++) { tmpArticles.push(

{res.data[i].title}

); - for (let j = 0; j < res.data[i].tags.length; j++) { - tmpArticles.push({res.data[i].tags[j].name}); - } tmpArticles.push( {new Date(res.data[i].createdAt).toLocaleDateString()} ); - tmpArticles.push(
{res.data[i].sanitizedHtml}
); + tmpArticles.push(
); + for (let j = 0; j < res.data[i].tags.length; j++) { + tmpArticles.push( + {res.data[i].tags[j].name} ); + } + tmpArticles.push(
); } console.log('test'); setArticles([...tmpArticles]); diff --git a/src/server/routes/api.ts b/src/server/routes/api.ts index ba30ac4..40b390a 100644 --- a/src/server/routes/api.ts +++ b/src/server/routes/api.ts @@ -15,7 +15,6 @@ router.delete('/signout', async (_req, res) => { }); router.get('/articles/:page', async (req, res) => { - console.log(parseInt(req.params.page)); const articles = await Article.findAll({ attributes: [ 'title',