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