From 8cf226fdd2c9fff35abbf6715e8a27cb2d8ca09d Mon Sep 17 00:00:00 2001 From: dekzter Date: Sun, 9 Mar 2025 09:32:11 -0400 Subject: [PATCH] not sure if we'll still use this, but updated it to work with new paginated streams --- frontend/src/store/streams.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/frontend/src/store/streams.js b/frontend/src/store/streams.js index a594b8a7..9f477c20 100644 --- a/frontend/src/store/streams.js +++ b/frontend/src/store/streams.js @@ -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 });