summary refs log tree commit diff
path: root/api/src/routes/guilds/#guild_id/voice-states/#user_id/index.ts
blob: 02951f815ec96494d745b1eaab0408cba0dd6b9e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import { check } from "../../../../../util/instanceOf";
import { VoiceStateUpdateSchema } from "../../../../../schema";
import { Request, Response, Router } from "express";
import { updateVoiceState } from "../../../../../util/VoiceState";

const router = Router();

router.patch("/", check(VoiceStateUpdateSchema), async (req: Request, res: Response) => {
	const body = req.body as VoiceStateUpdateSchema;
	const { guild_id, user_id } = req.params;
	await updateVoiceState(body, guild_id, req.user_id, user_id)
	return res.sendStatus(204);
});

export default router;