diff options
author | Thibaut Girka <thib@sitedethib.com> | 2019-02-10 21:28:29 +0100 |
---|---|---|
committer | Thibaut Girka <thib@sitedethib.com> | 2019-02-10 21:44:14 +0100 |
commit | a963ea67dda17f69ed783b3fbcc91e5ce3858ad3 (patch) | |
tree | 86989e490ae6b7ed7460a4cb2345a48d56e5efcd /app/javascript/flavours/glitch/actions/lists.js | |
parent | 6b2eefc7bf8cf1bb58da165d9594d9b17bf97e11 (diff) |
[Glitch] Add missing rejection handling for Promises
Port missing parts from 2c51bc0ca5a4c3a4bb140b4b40dabdda859ebb94 to glitch-soc
Diffstat (limited to 'app/javascript/flavours/glitch/actions/lists.js')
-rw-r--r-- | app/javascript/flavours/glitch/actions/lists.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/javascript/flavours/glitch/actions/lists.js b/app/javascript/flavours/glitch/actions/lists.js index 7d94ee950..f29ca1e01 100644 --- a/app/javascript/flavours/glitch/actions/lists.js +++ b/app/javascript/flavours/glitch/actions/lists.js @@ -1,4 +1,5 @@ import api from 'flavours/glitch/util/api'; +import { showAlertForError } from './alerts'; export const LIST_FETCH_REQUEST = 'LIST_FETCH_REQUEST'; export const LIST_FETCH_SUCCESS = 'LIST_FETCH_SUCCESS'; @@ -239,7 +240,8 @@ export const fetchListSuggestions = q => (dispatch, getState) => { }; api(getState).get('/api/v1/accounts/search', { params }) - .then(({ data }) => dispatch(fetchListSuggestionsReady(q, data))); + .then(({ data }) => dispatch(fetchListSuggestionsReady(q, data))) + .catch(error => dispatch(showAlertForError(error))); }; export const fetchListSuggestionsReady = (query, accounts) => ({ |