mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-20 20:29:06 +00:00
- Replace @hey-api/openapi-ts with openapi-typescript and openapi-react-query - Generate TypeScript types from OpenAPI spec - Set up React Query infrastructure with QueryClientProvider - Migrate all API hooks to use React Query patterns - Maintain backward compatibility for existing components - Remove old API infrastructure and dependencies
25 lines
597 B
TypeScript
25 lines
597 B
TypeScript
import { useRoomsList } from "../../lib/api-hooks";
|
|
import { Page_Room_ } from "../../api";
|
|
import { PaginationPage } from "../browse/_components/Pagination";
|
|
|
|
type RoomList = {
|
|
response: Page_Room_ | null;
|
|
loading: boolean;
|
|
error: Error | null;
|
|
refetch: () => void;
|
|
};
|
|
|
|
// Wrapper to maintain backward compatibility
|
|
const useRoomList = (page: PaginationPage): RoomList => {
|
|
const { data, isLoading, error, refetch } = useRoomsList(page);
|
|
|
|
return {
|
|
response: data || null,
|
|
loading: isLoading,
|
|
error: error as Error | null,
|
|
refetch,
|
|
};
|
|
};
|
|
|
|
export default useRoomList;
|