[web] Fixes #3228:API endpoint error

This commit is contained in:
Matthew Shao 2018-08-13 15:17:57 +08:00
parent e74e97bcd9
commit e9e2b7f443
2 changed files with 2 additions and 2 deletions

View File

@ -159,7 +159,7 @@ describe('flows actions', () => {
store.dispatch(flowActions.uploadContent(tflow, 'foo', 'foo'))
// window.Blob's lastModified is always the current time,
// which causes flaky tests on comparison.
expect(fetchApi).toBeCalledWith('/flows/1/foo/content', { method: 'POST', body: expect.anything()})
expect(fetchApi).toBeCalledWith('/flows/1/foo/content.data', { method: 'POST', body: expect.anything()})
})
it('should handle clear action', () => {

View File

@ -209,7 +209,7 @@ export function uploadContent(flow, file, type) {
const body = new FormData()
file = new window.Blob([file], { type: 'plain/text' })
body.append('file', file)
return dispatch => fetchApi(`/flows/${flow.id}/${type}/content`, { method: 'POST', body })
return dispatch => fetchApi(`/flows/${flow.id}/${type}/content.data`, { method: 'POST', body })
}