mirror of
https://github.com/strapi/strapi.git
synced 2025-09-21 22:40:24 +00:00
Remove API url origin
This commit is contained in:
parent
09c32d7d8c
commit
b5e6ba0f01
@ -13,7 +13,7 @@ export function* getModels() {
|
|||||||
cache: 'default',
|
cache: 'default',
|
||||||
};
|
};
|
||||||
const response = yield fetch(
|
const response = yield fetch(
|
||||||
'http://localhost:1337/content-manager/models',
|
'/content-manager/models',
|
||||||
opts
|
opts
|
||||||
);
|
);
|
||||||
const data = yield response.json();
|
const data = yield response.json();
|
||||||
|
@ -23,7 +23,7 @@ export function* getRecord(params) {
|
|||||||
const currentModelName = yield select(makeSelectCurrentModelName());
|
const currentModelName = yield select(makeSelectCurrentModelName());
|
||||||
|
|
||||||
try {
|
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')
|
// Call our request helper (see 'utils/request')
|
||||||
const data = yield call(request, requestUrl, {
|
const data = yield call(request, requestUrl, {
|
||||||
@ -45,7 +45,7 @@ export function* editRecord() {
|
|||||||
const id = isCreating ? '' : recordJSON.id;
|
const id = isCreating ? '' : recordJSON.id;
|
||||||
|
|
||||||
try {
|
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')
|
// Call our request helper (see 'utils/request')
|
||||||
yield call(request, requestUrl, {
|
yield call(request, requestUrl, {
|
||||||
@ -71,7 +71,7 @@ export function* deleteRecord() {
|
|||||||
const recordJSON = record.toJSON();
|
const recordJSON = record.toJSON();
|
||||||
|
|
||||||
try {
|
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')
|
// Call our request helper (see 'utils/request')
|
||||||
yield call(request, requestUrl, {
|
yield call(request, requestUrl, {
|
||||||
|
@ -30,7 +30,7 @@ export function* getRecords() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const requestUrl = `http://localhost:1337/content-manager/explorer/${currentModel}`;
|
const requestUrl = `/content-manager/explorer/${currentModel}`;
|
||||||
|
|
||||||
// Call our request helper (see 'utils/request')
|
// Call our request helper (see 'utils/request')
|
||||||
const data = yield call(request, requestUrl, {
|
const data = yield call(request, requestUrl, {
|
||||||
@ -54,7 +54,7 @@ export function* getCount() {
|
|||||||
cache: 'default',
|
cache: 'default',
|
||||||
};
|
};
|
||||||
const response = yield fetch(
|
const response = yield fetch(
|
||||||
`http://localhost:1337/content-manager/explorer/${currentModel}/count`,
|
`/content-manager/explorer/${currentModel}/count`,
|
||||||
opts
|
opts
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ export function* getRecords() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const requestUrl = `http://localhost:1337/content-manager/explorer/${currentModel}`;
|
const requestUrl = `/content-manager/explorer/${currentModel}`;
|
||||||
|
|
||||||
// Call our request helper (see 'utils/request')
|
// Call our request helper (see 'utils/request')
|
||||||
const data = yield call(request, requestUrl, {
|
const data = yield call(request, requestUrl, {
|
||||||
@ -54,7 +54,7 @@ export function* getCount() {
|
|||||||
cache: 'default',
|
cache: 'default',
|
||||||
};
|
};
|
||||||
const response = yield fetch(
|
const response = yield fetch(
|
||||||
`http://localhost:1337/content-manager/explorer/${currentModel}/count`,
|
`/content-manager/explorer/${currentModel}/count`,
|
||||||
opts
|
opts
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user