From 14bf6d45a47e32aeb8a8e501847d0681bdb120ef Mon Sep 17 00:00:00 2001 From: Akif9748 Date: Sun, 28 Aug 2022 17:34:29 +0300 Subject: [PATCH] fix for mobile and support for pages --- public/css/navbar.css | 8 -------- routes/api/routes/threads.js | 4 +++- routes/threads.js | 2 +- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/public/css/navbar.css b/public/css/navbar.css index 4d5d7c9..5bcd3f1 100644 --- a/public/css/navbar.css +++ b/public/css/navbar.css @@ -151,18 +151,10 @@ div.avatar { } @media (max-width: 480px) { - .btn-outline-primary { - width: 100%; - text-align: center; - } .buttons { flex-direction: column; width: 100%; } - .btn-primary { - width: 100%; - text-align: center; - } } \ No newline at end of file diff --git a/routes/api/routes/threads.js b/routes/api/routes/threads.js index 86508b0..9d9ab0b 100644 --- a/routes/api/routes/threads.js +++ b/routes/api/routes/threads.js @@ -21,16 +21,18 @@ app.get("/:id/messages/", async (req, res) => { const { id } = req.params; const limit = Number(req.query.limit); + const skip = Number(req.query.skip); const query = { threadID: id }; if (!req.user.admin) query.deleted = false; const options = { sort: { date: -1 } }; if (limit) options.limit = limit; + if (skip) options.skip = skip; const messages = await MessageModel.find(query, null, options) - if (!messages.length) return res.error(404, "We don't have any messages in this thread."); + if (!messages.length) return res.error(404, "We don't have any messages in this with your query thread."); res.complate(messages.map(x => x.toObject({ virtuals: true }))); diff --git a/routes/threads.js b/routes/threads.js index 5ae7d0b..b1a03f9 100644 --- a/routes/threads.js +++ b/routes/threads.js @@ -1,7 +1,7 @@ const { Router } = require("express"); const app = Router(); -const { ThreadModel, MessageModel } = require("../models") +const { ThreadModel } = require("../models") app.get("/", async (req, res) => {