let postid ip history work properly again, too

merge-requests/208/head
fatchan 4 years ago
parent cc16ceadb6
commit 9cbf198772
  1. 3
      models/pages/manage/recent.js

@ -9,12 +9,11 @@ module.exports = async (req, res, next) => {
const { page, offset, queryString } = pageQueryConverter(req.query, limit); const { page, offset, queryString } = pageQueryConverter(req.query, limit);
let ip = decodeQueryIP(req.query, res.locals.permLevel); let ip = decodeQueryIP(req.query, res.locals.permLevel);
console.log(ip)
const postId = typeof req.query.postid === 'string' ? req.query.postid : null; const postId = typeof req.query.postid === 'string' ? req.query.postid : null;
if (postId && +postId === parseInt(postId) && Number.isSafeInteger(+postId)) { if (postId && +postId === parseInt(postId) && Number.isSafeInteger(+postId)) {
const fetchedPost = await Posts.getPost(req.params.board, +postId, true); const fetchedPost = await Posts.getPost(req.params.board, +postId, true);
if (fetchedPost) { if (fetchedPost) {
ip = fetchedPost.ip.single; ip = decodeQueryIP({ ip: fetchedPost.ip.single.slice(-10) }, res.locals.permlevel);
} }
} }

Loading…
Cancel
Save