Restructure redux code (#109)

* Restructure redux code

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
Co-authored-by: Erik Michelson <github@erik.michelson.eu>
This commit is contained in:
mrdrogdrog 2020-05-31 22:51:36 +02:00 committed by GitHub
parent db5bec7000
commit 570c45017c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
28 changed files with 214 additions and 231 deletions

View file

@ -1,14 +1,13 @@
import { FrontendConfigState, SET_FRONTEND_CONFIG_ACTION_TYPE, SetFrontendConfigAction } from './types'
import { FrontendConfig } from '../../api/frontend-config/types'
import { store } from '../../utils/store'
import { FrontendConfigActionType, SetFrontendConfigAction } from './types'
export const setFrontendConfig = (state: FrontendConfigState): void => {
export const setFrontendConfig = (state: FrontendConfig): void => {
const action: SetFrontendConfigAction = {
type: SET_FRONTEND_CONFIG_ACTION_TYPE,
payload: {
state: {
...state,
backendUrl: state.backendUrl + '/api/v2.0/'
}
type: FrontendConfigActionType.SET_FRONTEND_CONFIG,
state: {
...state,
backendUrl: state.backendUrl + '/api/v2.0/'
}
}
store.dispatch(action)