diff --git a/frontend/src/api/getChannels.js b/frontend/src/api/getChannels.js index 5c0fe68..cab1747 100644 --- a/frontend/src/api/getChannels.js +++ b/frontend/src/api/getChannels.js @@ -1,7 +1,7 @@ import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react'; import apiPath from './apiPath'; -export const usersApi = createApi({ +export const channelsApi = createApi({ reducerPath: 'channels', baseQuery: fetchBaseQuery({ baseUrl: apiPath.channels() }), endpoints: (builder) => ({ @@ -13,4 +13,4 @@ export const usersApi = createApi({ export const { useGetChannelsQuery, -} = usersApi; +} = channelsApi; diff --git a/frontend/src/store/store.js b/frontend/src/store/store.js index 6a72e5b..b7d7893 100644 --- a/frontend/src/store/store.js +++ b/frontend/src/store/store.js @@ -1,10 +1,14 @@ import { configureStore } from '@reduxjs/toolkit'; +import { channelsApi } from '../api/getChannels'; + import authReducer from './slices/authSlice'; const store = configureStore({ reducer: { auth: authReducer, + [channelsApi.reducerPath]: channelsApi.reducer, }, + middleware: (getDefaultMiddleware) => getDefaultMiddleware().concat(channelsApi.middleware), }); export default store;