diff --git a/.circleci/config.yml b/.circleci/config.yml index 6803f4dd..1416aeec 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -105,7 +105,7 @@ jobs: - *restore_deps - - run: yarn flow + - run: yarn flow --max-workers 1 workflows: version: 2 diff --git a/package.json b/package.json index 77cff3cd..3dbe49b8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@signavio/kraken", - "version": "6.2.2", + "version": "6.2.3-0", "description": "Load API entities", "repository": "git@github.com:signavio/kraken.git", "main": "lib/index.js", diff --git a/src/reducers/requestsReducer.js b/src/reducers/requestsReducer.js index f810784a..b0730bef 100644 --- a/src/reducers/requestsReducer.js +++ b/src/reducers/requestsReducer.js @@ -31,6 +31,8 @@ const requestsReducer = (state: RequestsState, action: Action) => { refresh: payload.refresh !== undefined ? payload.refresh : request.refresh, value: needsRefresh ? undefined : request.value, + reason: null, + status: null, }, } case actionTypes.REQUEST_START: @@ -52,8 +54,10 @@ const requestsReducer = (state: RequestsState, action: Action) => { pending: false, fulfilled: true, rejected: false, - responseHeaders: payload.responseHeaders, value: payload.value, + responseHeaders: payload.responseHeaders, + reason: null, + status: payload.status, }, } case actionTypes.FETCH_FAILURE: diff --git a/test/specs/reducers/requestReducer.spec.js b/test/specs/reducers/requestReducer.spec.js index 405cf9b0..a2df1a81 100644 --- a/test/specs/reducers/requestReducer.spec.js +++ b/test/specs/reducers/requestReducer.spec.js @@ -57,6 +57,8 @@ describe('requestReducer', () => { 'requestParams', requestParams ) + expect(newState[newRequestId]).to.have.property('reason', null) + expect(newState[newRequestId]).to.have.property('status', null) }) it('should set pending and outstanding flags', () => { @@ -152,6 +154,7 @@ describe('requestReducer', () => { requestId, entityType: types.USER, query, + status: 200, value: result, }) ) @@ -161,6 +164,8 @@ describe('requestReducer', () => { expect(newState[requestId]).to.have.property('pending', false) expect(newState[requestId]).to.have.property('fulfilled', true) expect(newState[requestId]).to.have.property('rejected', false) + expect(newState[requestId]).to.have.property('reason', null) + expect(newState[requestId]).to.have.property('status', 200) }) it('should set the value', () => { @@ -258,11 +263,13 @@ describe('requestReducer', () => { entityType: types.USER, requestId, error, + status: 502, }) ) expect(newState).to.have.property(requestId) expect(newState[requestId]).to.have.property('reason', error) + expect(newState[requestId]).to.have.property('status', 502) }) }) })