mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-13 06:34:39 -04:00
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:
parent
db5bec7000
commit
570c45017c
28 changed files with 214 additions and 231 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue