mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 10:34:17 +00:00
20 lines
347 B
JavaScript
20 lines
347 B
JavaScript
import Posts from "@classes/posts"
|
|
|
|
export default {
|
|
useMiddlewares: ["withOptionalAuthentication"],
|
|
fn: async (req, res) => {
|
|
const payload = {
|
|
limit: req.query?.limit,
|
|
trim: req.query?.trim,
|
|
}
|
|
|
|
if (req.auth) {
|
|
payload.user_id = req.auth.session.user_id
|
|
}
|
|
|
|
const result = await Posts.timeline(payload)
|
|
|
|
return result
|
|
},
|
|
}
|