design changes
This commit is contained in:
@ -6,6 +6,7 @@ import {
|
||||
} from "@reduxjs/toolkit";
|
||||
import { setupListeners } from "@reduxjs/toolkit/query";
|
||||
import { AuthApi, User } from "../slice/AuthApi";
|
||||
import { QueueApi } from "../slice/QueueApi";
|
||||
|
||||
export type AuthDataType = {
|
||||
token: string | null;
|
||||
@ -43,6 +44,7 @@ export const store = configureStore({
|
||||
reducer: {
|
||||
// Add the generated reducer as a specific top-level slice
|
||||
[AuthApi.reducerPath]: AuthApi.reducer,
|
||||
[QueueApi.reducerPath]: QueueApi.reducer,
|
||||
auth: createReducer(initialAuthDataState, (builder) => {
|
||||
builder.addCase(updateToken, (state, action) => {
|
||||
state.token = action.payload;
|
||||
@ -81,7 +83,9 @@ export const store = configureStore({
|
||||
// Adding the api middleware enables caching, invalidation, polling,
|
||||
// and other useful features of `rtk-query`.
|
||||
middleware: (getDefaultMiddleware) =>
|
||||
getDefaultMiddleware().concat(AuthApi.middleware),
|
||||
getDefaultMiddleware()
|
||||
.concat(AuthApi.middleware)
|
||||
.concat(QueueApi.middleware),
|
||||
});
|
||||
|
||||
// optional, but required for refetchOnFocus/refetchOnReconnect behaviors
|
||||
|
||||
Reference in New Issue
Block a user