From 375f8ae5bbd3dcc95e11689ae396754429591b2c Mon Sep 17 00:00:00 2001 From: Stas Guma Date: Thu, 25 Apr 2024 20:02:44 +0300 Subject: [PATCH] update loadPath --- .../Session/model/slice/sessionSlice.test.ts | 14 +++++++------- src/shared/config/i18n/i18n.ts | 2 +- webpack.config.ts | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/entities/Session/model/slice/sessionSlice.test.ts b/src/entities/Session/model/slice/sessionSlice.test.ts index fad3e67..f075506 100644 --- a/src/entities/Session/model/slice/sessionSlice.test.ts +++ b/src/entities/Session/model/slice/sessionSlice.test.ts @@ -9,10 +9,7 @@ describe('sessionSlice', () => { const state = sessionReducer(undefined, { type: 'unknown' }); expect(state).toEqual({ loading: 'idle', - id: undefined, - username: undefined, - token: undefined, - isAuthenticated: false, + data: undefined, error: undefined, sessionInited: false, }); @@ -22,17 +19,20 @@ describe('sessionSlice', () => { const prevState: DeepPartial = {}; const sessionData = { - id: '1', + id: 1, username: 'Tomas', token: 'Bearer asdasdasda', isAuthenticated: true, - sessionInited: true, + role: 'admin', }; LocalStorage.setItem(LOCAL_STORAGE_SESSION_KEY, sessionData); const state = sessionReducer(prevState as SessionSchema, initSession()); - expect(state).toEqual(sessionData); + expect(state).toEqual({ + data: sessionData, + sessionInited: true, + }); }); }); diff --git a/src/shared/config/i18n/i18n.ts b/src/shared/config/i18n/i18n.ts index 69ba910..be9c812 100644 --- a/src/shared/config/i18n/i18n.ts +++ b/src/shared/config/i18n/i18n.ts @@ -17,7 +17,7 @@ i18n escapeValue: false, // react already safes from xss }, backend: { - loadPath: __IS_DEV__ ? '/locales/{{lng}}/{{ns}}.json' : '/public/locales/{{lng}}/{{ns}}.json', + // loadPath: __IS_DEV__ ? '/locales/{{lng}}/{{ns}}.json' : '/public/locales/{{lng}}/{{ns}}.json', }, }); diff --git a/webpack.config.ts b/webpack.config.ts index 7de48e2..d417cac 100644 --- a/webpack.config.ts +++ b/webpack.config.ts @@ -7,7 +7,7 @@ import { buildWebpackConfig } from './config/build/buildWebpackConfig'; export default (env: IBuildEnvironment): webpack.Configuration => { const mode: TBuildMode = env.development ? 'development' : 'production'; const isDev = mode === 'development'; - const publicPath = env.assetPath ?? '/'; + const publicPath = env.assetPath ?? 'auto'; const PORT = env.port ?? 8080; const paths: IBuildPaths = {