Files
fltr-app/hooks/useStreamingServices.ts
2025-10-29 20:50:21 +11:00

13 lines
447 B
TypeScript

import { useQuery } from "@tanstack/react-query";
import { getStreamingImages, StreamingServiceRaw } from "@/apis/streamingServiceApi";
export const useStreamingServices = () => {
return useQuery({
queryKey: ["streamingServices"],
queryFn: async () => {
const data: StreamingServiceRaw[] = await getStreamingImages();
const mapped = Object.fromEntries(data.map((s) => [s.key, s.value]));
return mapped;
},
});
};