diff options
Diffstat (limited to 'web/src/js/ducks/flows.js')
-rw-r--r-- | web/src/js/ducks/flows.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/web/src/js/ducks/flows.js b/web/src/js/ducks/flows.js index 3dd21016..eea91924 100644 --- a/web/src/js/ducks/flows.js +++ b/web/src/js/ducks/flows.js @@ -14,10 +14,12 @@ export const RECEIVE = 'FLOWS_RECEIVE' export const REQUEST_ACTION = 'FLOWS_REQUEST_ACTION' export const UNKNOWN_CMD = 'FLOWS_UNKNOWN_CMD' export const FETCH_ERROR = 'FLOWS_FETCH_ERROR' +export const SET_MODIFIED_FLOW_CONTENT = "FLOWS_SET_MODIFIED_FLOW" const defaultState = { list: undefined, views: undefined, + modifiedFlow: {headers: "", content: ""} } export default function reduce(state = defaultState, action) { @@ -51,6 +53,12 @@ export default function reduce(state = defaultState, action) { list, views: reduceViews(state.views, viewsActions.receive(list)), } + case SET_MODIFIED_FLOW_CONTENT: + return{ + ...state, + modifiedFlow: {...state.modifiedFlow, content: action.content} + } + default: return { @@ -64,6 +72,17 @@ export default function reduce(state = defaultState, action) { /** * @public */ +export function setModifiedFlowContent(content) { + return { + type: SET_MODIFIED_FLOW_CONTENT, + content + } +} + + +/** + * @public + */ export function accept(flow) { fetchApi(`/flows/${flow.id}/accept`, { method: 'POST' }) return { type: REQUEST_ACTION } |