Route posts without interesting queries to posts

master
Raymonzut 5 years ago
parent eec3738464
commit 9fdbd1b6a1
No known key found for this signature in database
GPG Key ID: 97CF2D8BE2C69FC7
  1. 3
      server/routes/api/posts.js

@ -37,7 +37,10 @@ routes.set('', async (req, res) => {
if (req.query.sort === '1') res.send(posts_sorted) if (req.query.sort === '1') res.send(posts_sorted)
else res.send(posts_sorted.reverse()) else res.send(posts_sorted.reverse())
return
} }
// Default response when there are no interesting queries
res.send(posts)
}) })
routes.set('/:id', async (req, res) => { routes.set('/:id', async (req, res) => {

Loading…
Cancel
Save