Skip to content

Commit 54e3e1d

Browse files
committed
Return expected values from action promise
1 parent 5df3275 commit 54e3e1d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/middleware/middleware.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ function middleware (options={}) {
119119
}
120120
// Send success action to API reducer
121121
if (requestKey) next(actions.setStatusSuccess(requestKey, response))
122+
return response
122123
},
123124
// Error handler
124125
error => {
@@ -134,6 +135,7 @@ function middleware (options={}) {
134135
if (requestKey) next(actions.setStatusFailure(requestKey, error))
135136
// Dispatch unauthorized action if applicable
136137
if (error.status === 401 && onUnauthorized) next(onUnauthorized())
138+
throw error
137139
}
138140
)
139141
}

0 commit comments

Comments
 (0)