MSP-3107 add appService

This commit is contained in:
veselovnk committed 2024-04-17 16:49:21 +03:00
1 parent c60a8dc825
commit 8a65a03a13
4 files changed
+81 -3

No files matched your search

+7 -2
View File
@@ -3,6 +3,7 @@ import { theme } from 'antd'
import { MapToken, SeedToken } from 'antd/es/theme/interface'
import { createContext, Dispatch, SetStateAction } from 'react'
import appApi from '@services/appService.ts'
import roleApi from '@services/roleService.ts'
import profileReducer from './redusers/ProfileSlice.ts'
@@ -20,14 +21,18 @@ export const Context = createContext<ContextProps>({
const rootReducer = combineReducers({
profileReducer,
[roleApi.reducerPath]: roleApi.reducer
[roleApi.reducerPath]: roleApi.reducer,
[appApi.reducerPath]: appApi.reducer,
})
export const setupStore = () =>
configureStore({
reducer: rootReducer,
middleware: (getDefaultMiddleware) =>
getDefaultMiddleware().concat([roleApi.middleware])
getDefaultMiddleware().concat(
roleApi.middleware,
appApi.middleware,
)
})
export type RootState = ReturnType<typeof rootReducer>