return async dispatch => { dispatch(request()); const content = await api.entity.getEntities( locale, project, resource, exclude, search, status, ); dispatch(receive(content.entities, content.has_next)); dispatch(statsActions.update(content.stats)); };
return async dispatch => { const results = await updateStatusOnServer(change, translation, resource); if (results.translation && change === 'approve' && nextEntity && nextEntity.pk !== entity) { // The change did work, we want to move on to the next Entity. dispatch(navActions.updateEntity(router, nextEntity.pk.toString())); } else { dispatch(get(entity, locale, pluralForm)); } if (results.stats) { dispatch(statsActions.update(results.stats)); } dispatch(listActions.updateEntityTranslation(entity, pluralForm, results.translation)); }