mirror of
https://github.com/Dispatcharr/Dispatcharr.git
synced 2026-07-18 09:06:06 +00:00
not sure if we'll still use this, but updated it to work with new paginated streams
This commit is contained in:
parent
9add00cf5c
commit
8cf226fdd2
1 changed files with 7 additions and 2 deletions
|
|
@ -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 });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue