Skip to content

Commit

Permalink
expose /personal api
Browse files Browse the repository at this point in the history
  • Loading branch information
dispherical committed Oct 19, 2024
1 parent d79b1ff commit edbc34c
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,19 @@ Array.prototype.random = function () {
const { id } = req.params
try {
const text = await getCloseChannels(id)
res.set("Content-Type","text/plain").send(text)
} catch(e){
res.set("Content-Type","text/plain").send("User not found").status(404)
res.set("Content-Type", "text/plain").send(text)
} catch (e) {
res.set("Content-Type", "text/plain").send("User not found").status(404)
}
});
receiver.router.get("/personal", async (req, res) => {
const channels = await prisma.channel.findMany({
where: {
personal: true
}
})
res.json(channels)
});

await require("./commands/optout")({ app, client, prisma });
await require("./commands/setlocation")({ app, client, prisma });
Expand Down

0 comments on commit edbc34c

Please sign in to comment.