1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-09-22 10:41:34 +02:00

Update index.ts

This commit is contained in:
Intevel ツ 2021-05-06 22:59:12 +02:00
parent df4d400ba6
commit a295f01915

View File

@ -17,7 +17,7 @@ router.get("/:template_id", async (req: Request, res: Response) => {
if (!guild) throw new HTTPError("Guild not found", 404);
if (!template_id) throw new HTTPError("Unknown template_id", 404);
const template = await TemplateModel.findById({ _id: template_id }).exec();
const template = await TemplateModel.findOne({ id: template_id }).exec();
if (!template) throw new HTTPError("template not found", 404);
res.json(toObject(template)).send();