room detail page fix

This commit is contained in:
Igor Loskutov
2025-09-02 18:52:31 -04:00
parent 05be6e7f19
commit 1d5a22ad1d
5 changed files with 240 additions and 77 deletions

View File

@@ -120,6 +120,34 @@ export function useTranscriptGet(transcriptId: string | null) {
);
}
export function useRoomGet(roomId: string | null) {
const { isAuthenticated } = useAuthReady();
return $api.useQuery(
"get",
"/v1/rooms/{room_id}",
{
params: {
path: { room_id: roomId || "" },
},
},
{
enabled: !!roomId && isAuthenticated,
staleTime: STALE_TIME,
},
);
}
export function useRoomTestWebhook() {
const { setError } = useError();
return $api.useMutation("post", "/v1/rooms/{room_id}/webhook/test", {
onError: (error) => {
setError(error as Error, "There was an error testing the webhook");
},
});
}
export function useRoomCreate() {
const { setError } = useError();
const queryClient = useQueryClient();