diff options
Diffstat (limited to 'web/src/js/ducks/flows.js')
-rw-r--r-- | web/src/js/ducks/flows.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/web/src/js/ducks/flows.js b/web/src/js/ducks/flows.js index dfcd5ba9..ffb7ac87 100644 --- a/web/src/js/ducks/flows.js +++ b/web/src/js/ducks/flows.js @@ -16,6 +16,7 @@ export const UNKNOWN_CMD = 'FLOWS_UNKNOWN_CMD' export const FETCH_ERROR = 'FLOWS_FETCH_ERROR' export const SELECT = 'FLOWS_SELECT' + const defaultState = { selected: [], ...reduceList(undefined, {}), @@ -118,6 +119,16 @@ export function update(flow, data) { return { type: REQUEST_ACTION } } +export function updateContent(flow, file, type) { + const body = new FormData() + if (typeof file !== File) + file = new Blob([file], {type: 'plain/text'}) + body.append('file', file) + fetchApi(`/flows/${flow.id}/${type}/content`, {method: 'post', body} ) + return { type: REQUEST_ACTION } +} + + /** * @public */ |