Completed Admin Users form
This commit is contained in:
28
apps/dispatch/app/_querys/livekit.ts
Normal file
28
apps/dispatch/app/_querys/livekit.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import axios from "axios";
|
||||
import { Room } from "livekit-client";
|
||||
import { ParticipantInfo } from "livekit-server-sdk";
|
||||
|
||||
export const getLivekitRooms = async () => {
|
||||
const res = await axios.get<
|
||||
{
|
||||
room: Room;
|
||||
participants: ParticipantInfo[];
|
||||
}[]
|
||||
>("/api/livekit-participant");
|
||||
|
||||
if (res.status !== 200) {
|
||||
throw new Error("Failed to fetch keywords");
|
||||
}
|
||||
return res.data;
|
||||
};
|
||||
|
||||
export const kickLivekitParticipant = async (body: { identity: string; roomName: string }) => {
|
||||
const res = await axios.delete("/api/livekit-participant", {
|
||||
params: body,
|
||||
});
|
||||
|
||||
if (res.status !== 200) {
|
||||
throw new Error("Failed to kick participant");
|
||||
}
|
||||
return res.data;
|
||||
};
|
||||
Reference in New Issue
Block a user