mirror of
https://github.com/Akif9748/akf-forum.git
synced 2024-11-22 20:10:40 +03:00
fix for mobile and support for pages
This commit is contained in:
parent
7b4dc19cb7
commit
14bf6d45a4
3 changed files with 4 additions and 10 deletions
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -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 })));
|
||||
|
||||
|
|
|
@ -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) => {
|
||||
|
|
Loading…
Reference in a new issue