Patron: Expect proxied endpoints

This commit is contained in:
Alex Gleason 2020-07-01 15:08:18 -05:00
parent 8144c7d508
commit 2d194d75aa
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -1,12 +1,11 @@
import axios from 'axios';
import api from '../api';
export const PATRON_FUNDING_IMPORT = 'PATRON_FUNDING_IMPORT';
export const PATRON_FUNDING_FETCH_FAIL = 'PATRON_FUNDING_FETCH_FAIL';
export function fetchFunding() {
return (dispatch, getState) => {
const baseUrl = getState().getIn(['soapbox', 'extensions', 'patron', 'baseUrl']);
axios.get(`${baseUrl}/api/patron/v1/instance`).then(response => {
api(getState).get('/api/patron/v1/instance').then(response => {
dispatch(importFetchedFunding(response.data));
}).catch(error => {
dispatch(fetchFundingFail(error));