mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-20 20:29:06 +00:00
feat: complete migration from @hey-api/openapi-ts to openapi-react-query
- Migrated all components from useApi compatibility layer to direct React Query hooks - Added new hooks for participant operations, room meetings, and speaker operations - Updated all imports from old api module to api-types - Fixed TypeScript types and API endpoint signatures - Removed deprecated useApi.ts compatibility layer - Fixed SourceKind enum values to match OpenAPI spec - Added @ts-ignore for Zulip endpoints not in OpenAPI spec yet - Fixed all compilation errors and type issues
This commit is contained in:
@@ -16,7 +16,7 @@ import {
|
||||
} from "@chakra-ui/react";
|
||||
import { useEffect, useState } from "react";
|
||||
import useRoomList from "./useRoomList";
|
||||
import { ApiError, Room } from "../../lib/api-types";
|
||||
import { Room } from "../../lib/api-types";
|
||||
import {
|
||||
useRoomCreate,
|
||||
useRoomUpdate,
|
||||
@@ -92,8 +92,10 @@ export default function RoomsList() {
|
||||
const createRoomMutation = useRoomCreate();
|
||||
const updateRoomMutation = useRoomUpdate();
|
||||
const deleteRoomMutation = useRoomDelete();
|
||||
const { data: streams = [] } = useZulipStreams();
|
||||
const { data: topics = [] } = useZulipTopics(selectedStreamId);
|
||||
const { data: streams = [] } = useZulipStreams() as { data: any[] };
|
||||
const { data: topics = [] } = useZulipTopics(selectedStreamId) as {
|
||||
data: Topic[];
|
||||
};
|
||||
interface Topic {
|
||||
name: string;
|
||||
}
|
||||
@@ -177,11 +179,10 @@ export default function RoomsList() {
|
||||
setNameError("");
|
||||
refetch();
|
||||
onClose();
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
if (
|
||||
err instanceof ApiError &&
|
||||
err.status === 400 &&
|
||||
(err.body as any).detail == "Room name is not unique"
|
||||
err?.status === 400 &&
|
||||
err?.body?.detail == "Room name is not unique"
|
||||
) {
|
||||
setNameError(
|
||||
"This room name is already taken. Please choose a different name.",
|
||||
|
||||
Reference in New Issue
Block a user