fix: Do not use relative api locations
This commit is contained in:
@ -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,
|
||||
|
@ -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);
|
||||
|
Reference in New Issue
Block a user