sticker impl

This commit is contained in:
MathMan05
2026-03-03 20:33:47 -06:00
committed by Rory&
parent 43f2b8de58
commit a8ba2d6553
2 changed files with 55 additions and 1 deletions
+16 -1
View File
@@ -33,7 +33,22 @@ router.get(
async (req: Request, res: Response) => {
const { sticker_id } = req.params as { [key: string]: string };
res.json(await Sticker.find({ where: { id: sticker_id } }));
res.json(await Sticker.findOne({ where: { id: sticker_id } }));
},
);
router.get(
"/guild",
route({
responses: {
200: {
body: "Sticker",
},
},
}),
async (req: Request, res: Response) => {
const { sticker_id } = req.params as { [key: string]: string };
const sticker = await Sticker.findOne({ where: { id: sticker_id }, relations: { guild: true } });
res.json(await sticker?.guild?.ToGuildSource());
},
);