feat: implement find_all method in ChannelRepository and update related services and routes for public access
This commit is contained in:
@@ -9,8 +9,8 @@ export function useChannels() {
|
||||
const { token } = useAuthContext();
|
||||
return useQuery({
|
||||
queryKey: ["channels"],
|
||||
queryFn: () => api.channels.list(token!),
|
||||
enabled: !!token,
|
||||
// Public endpoint — no token needed for TV viewing
|
||||
queryFn: () => api.channels.list(token ?? ""),
|
||||
});
|
||||
}
|
||||
|
||||
@@ -85,8 +85,8 @@ export function useCurrentBroadcast(channelId: string) {
|
||||
const { token } = useAuthContext();
|
||||
return useQuery({
|
||||
queryKey: ["broadcast", channelId],
|
||||
queryFn: () => api.schedule.getCurrentBroadcast(channelId, token!),
|
||||
enabled: !!token && !!channelId,
|
||||
queryFn: () => api.schedule.getCurrentBroadcast(channelId, token ?? ""),
|
||||
enabled: !!channelId,
|
||||
refetchInterval: 30_000,
|
||||
retry: false,
|
||||
});
|
||||
@@ -96,7 +96,7 @@ export function useEpg(channelId: string, from?: string, until?: string) {
|
||||
const { token } = useAuthContext();
|
||||
return useQuery({
|
||||
queryKey: ["epg", channelId, from, until],
|
||||
queryFn: () => api.schedule.getEpg(channelId, token!, from, until),
|
||||
enabled: !!token && !!channelId,
|
||||
queryFn: () => api.schedule.getEpg(channelId, token ?? "", from, until),
|
||||
enabled: !!channelId,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user