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

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;