Remove API url origin

This commit is contained in:
Pierre Burgy 2017-06-19 19:49:15 +02:00
parent 09c32d7d8c
commit b5e6ba0f01
4 changed files with 8 additions and 8 deletions

View File

@ -13,7 +13,7 @@ export function* getModels() {
cache: 'default',
};
const response = yield fetch(
'http://localhost:1337/content-manager/models',
'/content-manager/models',
opts
);
const data = yield response.json();

View File

@ -23,7 +23,7 @@ export function* getRecord(params) {
const currentModelName = yield select(makeSelectCurrentModelName());
try {
const requestUrl = `http://localhost:1337/content-manager/explorer/${currentModelName}/${params.id}`;
const requestUrl = `/content-manager/explorer/${currentModelName}/${params.id}`;
// Call our request helper (see 'utils/request')
const data = yield call(request, requestUrl, {
@ -45,7 +45,7 @@ export function* editRecord() {
const id = isCreating ? '' : recordJSON.id;
try {
const requestUrl = `http://localhost:1337/content-manager/explorer/${currentModelName}/${id}`;
const requestUrl = `/content-manager/explorer/${currentModelName}/${id}`;
// Call our request helper (see 'utils/request')
yield call(request, requestUrl, {
@ -71,7 +71,7 @@ export function* deleteRecord() {
const recordJSON = record.toJSON();
try {
const requestUrl = `http://localhost:1337/content-manager/explorer/${currentModelName}/${recordJSON.id}`;
const requestUrl = `/content-manager/explorer/${currentModelName}/${recordJSON.id}`;
// Call our request helper (see 'utils/request')
yield call(request, requestUrl, {

View File

@ -30,7 +30,7 @@ export function* getRecords() {
};
try {
const requestUrl = `http://localhost:1337/content-manager/explorer/${currentModel}`;
const requestUrl = `/content-manager/explorer/${currentModel}`;
// Call our request helper (see 'utils/request')
const data = yield call(request, requestUrl, {
@ -54,7 +54,7 @@ export function* getCount() {
cache: 'default',
};
const response = yield fetch(
`http://localhost:1337/content-manager/explorer/${currentModel}/count`,
`/content-manager/explorer/${currentModel}/count`,
opts
);

View File

@ -30,7 +30,7 @@ export function* getRecords() {
};
try {
const requestUrl = `http://localhost:1337/content-manager/explorer/${currentModel}`;
const requestUrl = `/content-manager/explorer/${currentModel}`;
// Call our request helper (see 'utils/request')
const data = yield call(request, requestUrl, {
@ -54,7 +54,7 @@ export function* getCount() {
cache: 'default',
};
const response = yield fetch(
`http://localhost:1337/content-manager/explorer/${currentModel}/count`,
`/content-manager/explorer/${currentModel}/count`,
opts
);