Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed dist/.DS_Store
Binary file not shown.
9 changes: 5 additions & 4 deletions dist/nativescript/contentstack.js
Original file line number Diff line number Diff line change
Expand Up @@ -1063,7 +1063,7 @@ var Stack = function () {
* @example
* Stack.sync({'init': true, 'start_date': '2018-10-22'}) //For initializing sync with entries published after a specific date
* @example
* Stack.sync({'init': true, 'content_type_id': 'session'}) //For initializing sync with entries of a specific content type
* Stack.sync({'init': true, 'content_type_uid': 'session'}) //For initializing sync with entries of a specific content type
* @example
* Stack.sync({'init': true, 'type': 'entry_published'}) //Use the type parameter to get a specific type of content.Supports 'asset_published', 'entry_published', 'asset_unpublished', 'entry_unpublished', 'asset_deleted', 'entry_deleted', 'content_type_deleted'.
* @example
Expand Down Expand Up @@ -1200,14 +1200,15 @@ function Request(options, fetchOptions) {
}, fetchOptions);

(0, _http2.default)(url + '?' + queryParams, option).then(function (response) {
var data = response.json();
if (response.ok && response.status === 200) {
var data = response.json();
resolve(data);
} else {
reject(response.statusText);
return data;
}
}).then(function (json) {
reject(json);
}).catch(function (error) {
console.log("Error: ", error);
reject(error);
});
});
Expand Down
9 changes: 5 additions & 4 deletions dist/node/contentstack.js
Original file line number Diff line number Diff line change
Expand Up @@ -1159,7 +1159,7 @@ var Stack = function () {
* @example
* Stack.sync({'init': true, 'start_date': '2018-10-22'}) //For initializing sync with entries published after a specific date
* @example
* Stack.sync({'init': true, 'content_type_id': 'session'}) //For initializing sync with entries of a specific content type
* Stack.sync({'init': true, 'content_type_uid': 'session'}) //For initializing sync with entries of a specific content type
* @example
* Stack.sync({'init': true, 'type': 'entry_published'}) //Use the type parameter to get a specific type of content.Supports 'asset_published', 'entry_published', 'asset_unpublished', 'entry_unpublished', 'asset_deleted', 'entry_deleted', 'content_type_deleted'.
* @example
Expand Down Expand Up @@ -1699,14 +1699,15 @@ function Request(options, fetchOptions) {
}, fetchOptions);

(0, _http2.default)(url + '?' + queryParams, option).then(function (response) {
var data = response.json();
if (response.ok && response.status === 200) {
var data = response.json();
resolve(data);
} else {
reject(response.statusText);
return data;
}
}).then(function (json) {
reject(json);
}).catch(function (error) {
console.log("Error: ", error);
reject(error);
});
});
Expand Down
9 changes: 5 additions & 4 deletions dist/react-native/contentstack.js
Original file line number Diff line number Diff line change
Expand Up @@ -1063,7 +1063,7 @@ var Stack = function () {
* @example
* Stack.sync({'init': true, 'start_date': '2018-10-22'}) //For initializing sync with entries published after a specific date
* @example
* Stack.sync({'init': true, 'content_type_id': 'session'}) //For initializing sync with entries of a specific content type
* Stack.sync({'init': true, 'content_type_uid': 'session'}) //For initializing sync with entries of a specific content type
* @example
* Stack.sync({'init': true, 'type': 'entry_published'}) //Use the type parameter to get a specific type of content.Supports 'asset_published', 'entry_published', 'asset_unpublished', 'entry_unpublished', 'asset_deleted', 'entry_deleted', 'content_type_deleted'.
* @example
Expand Down Expand Up @@ -1200,14 +1200,15 @@ function Request(options, fetchOptions) {
}, fetchOptions);

(0, _http2.default)(url + '?' + queryParams, option).then(function (response) {
var data = response.json();
if (response.ok && response.status === 200) {
var data = response.json();
resolve(data);
} else {
reject(response.statusText);
return data;
}
}).then(function (json) {
reject(json);
}).catch(function (error) {
console.log("Error: ", error);
reject(error);
});
});
Expand Down
2 changes: 1 addition & 1 deletion dist/web/contentstack.js

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions src/core/lib/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,16 @@ export default function Request(options, fetchOptions) {
fetchOptions);

fetch(url + '?' + queryParams, option)
.then(function(response) {
.then(function(response) {
let data = response.json();
if (response.ok && response.status === 200) {
let data = response.json();
resolve(data);
} else {
reject(response.statusText);
return data;
}
}).then((json) => {
reject(json)
}).catch(function(error) {
console.log("Error: ", error);
reject(error);
});
});
Expand Down