Skip to content
This repository has been archived by the owner on Jan 1, 2024. It is now read-only.

Commit

Permalink
fix(links-reducer): update reducer and tests
Browse files Browse the repository at this point in the history
fix(links-reducer): update reducer and tests
  • Loading branch information
Metnew committed Feb 18, 2018
1 parent 0d61178 commit 5d0262c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/common/reducers/links/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ export function links (state: State = initialState, action): State {
}
}
case GET_LINKS_FULFILLED: {
const entities = action.payload.data
const entities = action.payload
return {
...state,
entities,
fetchStatus: 'loaded'
}
}
case GET_LINKS_REJECTED: {
const errors = action.payload.data
const errors = action.payload
return {
...state,
errors,
Expand Down
6 changes: 2 additions & 4 deletions src/common/reducers/links/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,15 @@ describe('LINKS REDUCER', () => {
const fail = {
type: GET_LINKS_REJECTED,
payload: {
errors: {
hmm: 'thatsanerror'
}
hmm: 'thatsanerror'
}
}
expect(reducer(initialState, fail)).toEqual({
...initialState,
errors: {
hmm: 'thatsanerror'
},
fetchStatus: 'loaded'
fetchStatus: 'error'
})
})

Expand Down

0 comments on commit 5d0262c

Please sign in to comment.