diff --git a/client/src/components/Donation/components/DonateForm.js b/client/src/components/Donation/components/DonateForm.js index 47d6ed7f78..b0eeeade59 100644 --- a/client/src/components/Donation/components/DonateForm.js +++ b/client/src/components/Donation/components/DonateForm.js @@ -121,7 +121,7 @@ class DonateForm extends Component { })); const chargeStripePath = isSignedIn ? - '/internal/donate/charge-stripe' : + `${apiLocation}/internal/donate/charge-stripe` : `${apiLocation}/unauthenticated/donate/charge-stripe`; return postJSON$(chargeStripePath, { token, diff --git a/client/src/utils/ajax.js b/client/src/utils/ajax.js index 5d522cc5f3..4743eadd27 100644 --- a/client/src/utils/ajax.js +++ b/client/src/utils/ajax.js @@ -1,7 +1,8 @@ import axios from 'axios'; -import qs from 'query-string'; -const base = '/internal'; +import { apiLocation } from '../../config/env.json'; + +const base = `${apiLocation}/internal`; function get(path) { return axios.get(`${base}${path}`); @@ -42,29 +43,11 @@ export function getUsernameExists(username) { } export function getArticleById(shortId) { - return get( - `/n/${shortId}` - ); -} - -export function getFeaturedList(skip = 0) { - return get( - `/api/articles?${qs.stringify({ - filter: JSON.stringify({ - where: { featured: true, published: true }, - order: 'firstPublishedDate DESC', - limit: 10, - skip - }) - })}` - ); + return get(`/n/${shortId}`); } /** POST **/ -export function postPopularityEvent(event) { - return post('/p', event); -} export function postReportUser(body) { return post('/user/report-user', body);