mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 10:34:17 +00:00
17 lines
433 B
JavaScript
Executable File
17 lines
433 B
JavaScript
Executable File
import { UserFollow } from "@db_models"
|
|
|
|
export default {
|
|
method: "GET",
|
|
route: "/user/:user_id",
|
|
middlewares: ["withAuthentication"],
|
|
fn: async (req, res) => {
|
|
const isFollowed = await UserFollow.findOne({
|
|
user_id: req.user._id.toString(),
|
|
to: req.params.user_id,
|
|
}).catch(() => false)
|
|
|
|
return res.json({
|
|
isFollowed: Boolean(isFollowed),
|
|
})
|
|
}
|
|
} |