From 9fdbd1b6a135d468046eb00a14a08401c20b85a7 Mon Sep 17 00:00:00 2001 From: Raymonzut <40148684+Raymonzut@users.noreply.github.com> Date: Fri, 15 May 2020 13:11:15 +0200 Subject: [PATCH] Route posts without interesting queries to posts --- server/routes/api/posts.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/routes/api/posts.js b/server/routes/api/posts.js index e21795a..835529a 100644 --- a/server/routes/api/posts.js +++ b/server/routes/api/posts.js @@ -37,7 +37,10 @@ routes.set('', async (req, res) => { if (req.query.sort === '1') res.send(posts_sorted) else res.send(posts_sorted.reverse()) + return } + // Default response when there are no interesting queries + res.send(posts) }) routes.set('/:id', async (req, res) => {