not sure if we'll still use this, but updated it to work with new paginated streams

This commit is contained in:
dekzter 2025-03-09 09:32:11 -04:00
parent 9add00cf5c
commit 8cf226fdd2

View file

@ -3,14 +3,19 @@ import api from '../api';
const useStreamsStore = create((set) => ({
streams: [],
count: 0,
isLoading: false,
error: null,
fetchStreams: async () => {
set({ isLoading: true, error: null });
try {
const streams = await api.getStreams();
set({ streams: streams, isLoading: false });
const response = await api.getStreams();
set({
streams: response.results,
count: response.count,
isLoading: false,
});
} catch (error) {
console.error('Failed to fetch streams:', error);
set({ error: 'Failed to load streams.', isLoading: false });