Channel utility methods in entity

This commit is contained in:
Flam3rboy
2021-08-31 17:57:44 +02:00
parent 1c897af1be
commit 9400fc8fb8
2 changed files with 1 additions and 54 deletions
+1 -2
View File
@@ -4,7 +4,6 @@ import { HTTPError } from "lambert-server";
import { ChannelModifySchema } from "../../../schema/Channel";
import { check } from "../../../util/instanceOf";
import { createChannel } from "../../../util/Channel";
const router = Router();
router.get("/", async (req: Request, res: Response) => {
@@ -22,7 +21,7 @@ router.post("/", check(ChannelModifySchema), async (req: Request, res: Response)
const { guild_id } = req.params;
const body = req.body as ChannelModifySchema;
const channel = await createChannel({ ...body, guild_id }, req.user_id);
const channel = await Channel.createChannel({ ...body, guild_id }, req.user_id);
res.status(201).json(channel);
});