[Glitch] Fix to update suggestion list after dismiss

Port 86458297ac to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
th-downstream
Takeshi Umeda 4 years ago committed by Claire
parent 872d5d508d
commit 596855eded

@ -48,5 +48,12 @@ export const dismissSuggestion = accountId => (dispatch, getState) => {
id: accountId, id: accountId,
}); });
api(getState).delete(`/api/v1/suggestions/${accountId}`); api(getState).delete(`/api/v1/suggestions/${accountId}`).then(() => {
dispatch(fetchSuggestionsRequest());
api(getState).get('/api/v2/suggestions').then(response => {
dispatch(importFetchedAccounts(response.data.map(x => x.account)));
dispatch(fetchSuggestionsSuccess(response.data));
}).catch(error => dispatch(fetchSuggestionsFail(error)));
}).catch(() => {});
}; };

Loading…
Cancel
Save