diff --git a/frontend/src/features/api/apiSlice.js b/frontend/src/features/api/apiSlice.js index 59c2425..21375af 100644 --- a/frontend/src/features/api/apiSlice.js +++ b/frontend/src/features/api/apiSlice.js @@ -2,19 +2,17 @@ import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react' import { createSelector} from '@reduxjs/toolkit' - // Define our single API slice object export const apiSlice = createApi({ // The cache reducer expects to be added at `state.api` (already default - this is optional) reducerPath: 'api', - // All of our requests will have URLs starting with '/fakeApi' baseQuery: fetchBaseQuery({ baseUrl: process.env.REACT_APP_BACKEND_SERVER }), // The "endpoints" represent operations and requests for this server endpoints: builder => ({ // The `getPosts` endpoint is a "query" operation that returns data getGroups: builder.query({ - // The URL for the request is '/fakeApi/posts' + // The URL for the request is '/fakeApi/posts query: (shortName) => ({ url: `/${shortName}/groups` }) }), getSystems: builder.query({ diff --git a/frontend/src/features/call/callSlice.js b/frontend/src/features/call/callSlice.js new file mode 100644 index 0000000..e69de29 diff --git a/frontend/src/features/group/groupSlice.js b/frontend/src/features/group/groupSlice.js new file mode 100644 index 0000000..640e1d4 --- /dev/null +++ b/frontend/src/features/group/groupSlice.js @@ -0,0 +1,11 @@ +const groupSlice = createSlice({ + name: 'group', + initialState: [], + reducers: { + }, + }) + + // Extract the action creators object and the reducer +const { actions, reducer } = groupSlice +// Export the reducer, either as a default or named export +export default reducer \ No newline at end of file diff --git a/frontend/src/redux-router/configureStore.js b/frontend/src/redux-router/configureStore.js index 54059eb..16e62ec 100644 --- a/frontend/src/redux-router/configureStore.js +++ b/frontend/src/redux-router/configureStore.js @@ -1,6 +1,7 @@ // https://github.com/supasate/connected-react-router // configureStore.js + import { createBrowserHistory } from 'history' import { applyMiddleware, compose, createStore } from 'redux' import { routerMiddleware } from 'connected-react-router' @@ -9,7 +10,8 @@ import { apiSlice } from '../features/api/apiSlice' import thunk from 'redux-thunk'; -export const history = createBrowserHistory() +import { apiSlice } from '../features/api/apiSlice' + export default function configureStore(preloadedState) { const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;