Moving some counter queries out of subqueries in the API
This commit is contained in:
parent
4b5b953d42
commit
fc90d38893
9 changed files with 62 additions and 9 deletions
|
@ -1,11 +1,13 @@
|
|||
import { showAlert } from '../actions/alerts';
|
||||
|
||||
const defaultSuccessSuffix = 'SUCCESS';
|
||||
const defaultFailSuffix = 'FAIL';
|
||||
|
||||
export default function errorsMiddleware() {
|
||||
return ({ dispatch }) => next => action => {
|
||||
if (action.type) {
|
||||
const isFail = new RegExp(`${defaultFailSuffix}$`, 'g');
|
||||
const isSuccess = new RegExp(`${defaultSuccessSuffix}$`, 'g');
|
||||
|
||||
if (action.type.match(isFail)) {
|
||||
if (action.error.response) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue