Skip to content

Commit

Permalink
add name->id api
Browse files Browse the repository at this point in the history
  • Loading branch information
dispherical committed Oct 20, 2024
1 parent bb5fff2 commit 14863a2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,18 @@ var activeConnections = [];
else return res.json({ name: channel.name })
});

receiver.router.get("/id/:name", async (req, res) => {
const { name } = req.params

const channel = await prisma.channel.findFirst({
where: {
name
}
})
if (!channel) return res.json({ id: null })
else return res.json({ id: channel.id })
});

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

0 comments on commit 14863a2

Please sign in to comment.