Files
reflector/www/app/(app)/rooms/useRoomList.tsx
Mathieu Virbel 7ddae5ddd5 refactor: remove api-types.ts compatibility layer
- Migrated all 29 files from api-types.ts to use reflector-api.d.ts directly
- Removed $SourceKind manual enum in favor of OpenAPI-generated types
- Fixed unrelated Spinner component TypeScript error in AuthWrapper.tsx
- All imports now use: import type { components } from "path/to/reflector-api"
- Deleted api-types.ts file completely
2025-08-29 16:35:33 -06:00

27 lines
668 B
TypeScript

import { useRoomsList } from "../../lib/api-hooks";
import type { components } from "../../reflector-api";
type Page_Room_ = components["schemas"]["Page_Room_"];
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;