fix for mobile and support for pages

This commit is contained in:
Akif9748 2022-08-28 17:34:29 +03:00
parent 7b4dc19cb7
commit 14bf6d45a4
3 changed files with 4 additions and 10 deletions

View file

@ -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;
}
}

View file

@ -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 })));

View file

@ -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) => {