0
0
Fork 0

Remove the access token from Redux & context (#30275)

This commit is contained in:
Renaud Chaput 2024-05-22 16:45:18 +02:00 committed by GitHub
parent 2c75cf8599
commit 2c5ab8f647
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
35 changed files with 225 additions and 226 deletions

View file

@ -10,10 +10,10 @@ export const SUGGESTIONS_FETCH_FAIL = 'SUGGESTIONS_FETCH_FAIL';
export const SUGGESTIONS_DISMISS = 'SUGGESTIONS_DISMISS';
export function fetchSuggestions(withRelationships = false) {
return (dispatch, getState) => {
return (dispatch) => {
dispatch(fetchSuggestionsRequest());
api(getState).get('/api/v2/suggestions', { params: { limit: 20 } }).then(response => {
api().get('/api/v2/suggestions', { params: { limit: 20 } }).then(response => {
dispatch(importFetchedAccounts(response.data.map(x => x.account)));
dispatch(fetchSuggestionsSuccess(response.data));
@ -48,11 +48,11 @@ export function fetchSuggestionsFail(error) {
};
}
export const dismissSuggestion = accountId => (dispatch, getState) => {
export const dismissSuggestion = accountId => (dispatch) => {
dispatch({
type: SUGGESTIONS_DISMISS,
id: accountId,
});
api(getState).delete(`/api/v1/suggestions/${accountId}`).catch(() => {});
api().delete(`/api/v1/suggestions/${accountId}`).catch(() => {});
};