From ad7c13e6f424d3e85176c3f0d64e414d3227db5a Mon Sep 17 00:00:00 2001
From: Bastien DUMONT <bdumont@grandlyon.com>
Date: Tue, 13 Jun 2023 14:54:06 +0000
Subject: [PATCH] chore(redux-rtk): add actions to redux extension

---
 src/store/index.ts                         | 13 +++++++++++--
 src/store/profileType/profileType.slice.ts |  1 -
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/store/index.ts b/src/store/index.ts
index 6b9fba03a..b703e919b 100644
--- a/src/store/index.ts
+++ b/src/store/index.ts
@@ -66,7 +66,15 @@ export interface AppStore {
   cozy: unknown
 }
 
-// todo refactor types ?
+const appActions = {
+  ...analysisSlice.actions,
+  ...challengeSlice.actions,
+  ...chartSlice.actions,
+  ...modalSlice.actions,
+  ...profileTypeSlice.actions,
+}
+
+// TODO refactor types with AppActionsTypes = typeof appActions
 export type AppActionsTypes =
   | AnalysisActionTypes
   | ChallengeActionTypes
@@ -81,7 +89,8 @@ const sentryReduxEnhancer = Sentry.createReduxEnhancer({})
 
 const configureStore = (client: Client, persistedState: any) => {
   const middlewares = [thunkMiddleware.withExtraArgument({ client })]
-  const composeEnhancers = composeWithDevTools({ trace: true }) || compose
+  const composeEnhancers =
+    composeWithDevTools({ trace: true, actionCreators: appActions }) || compose
 
   const store: Store<AppStore, AppActionsTypes> = createStore(
     combineReducers({
diff --git a/src/store/profileType/profileType.slice.ts b/src/store/profileType/profileType.slice.ts
index ec4beee13..e267f6fce 100644
--- a/src/store/profileType/profileType.slice.ts
+++ b/src/store/profileType/profileType.slice.ts
@@ -54,4 +54,3 @@ export const profileTypeSlice = createSlice({
 })
 
 export const { setProfileType } = profileTypeSlice.actions
-export default profileTypeSlice.reducer
-- 
GitLab