mirror of
https://github.com/spacebarchat/server.git
synced 2026-05-24 19:05:29 +00:00
sticker impl
This commit is contained in:
@@ -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());
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user