contentful
Advanced tools
Comparing version 3.4.1 to 3.4.2
@@ -132,4 +132,5 @@ 'use strict'; | ||
var resolveLinks = shouldLinksResolve(query); | ||
var resolveForAllLocales = query.locale && query.locale === '*'; | ||
return http.get('entries', (0, _createRequestConfig2.default)({ query: query })).then(function (response) { | ||
return wrapEntryCollection(response.data, resolveLinks); | ||
return wrapEntryCollection(response.data, resolveLinks, resolveForAllLocales); | ||
}, errorHandler); | ||
@@ -136,0 +137,0 @@ } |
@@ -128,7 +128,7 @@ 'use strict'; | ||
*/ | ||
function wrapEntryCollection(data, resolveLinks) { | ||
function wrapEntryCollection(data, resolveLinks, resolveForAllLocales) { | ||
var wrappedData = (0, _stringifySafe2.default)((0, _toPlainObject2.default)((0, _cloneDeep2.default)(data))); | ||
if (resolveLinks) { | ||
var includes = prepareIncludes(wrappedData.includes, wrappedData.items); | ||
(0, _linkGetters2.default)(wrappedData.items, includes); | ||
(0, _linkGetters2.default)(wrappedData.items, includes, resolveForAllLocales); | ||
} | ||
@@ -135,0 +135,0 @@ return (0, _freezeSys2.default)(wrappedData); |
@@ -45,6 +45,11 @@ 'use strict'; | ||
*/ | ||
function mixinLinkGetters(items, includes) { | ||
function mixinLinkGetters(items, includes, resolveForAllLocales) { | ||
var linkGetter = (0, _memoize2.default)(getLinksFromIncludes, memoizationResolver); | ||
(0, _each2.default)(items, function (item) { | ||
return setLocalizedFieldGetters(item.fields, !!item.sys.locale); | ||
// TODO: workaround the preview endpoint extra locale this should be removed when | ||
// it is fixed on the backend | ||
if (resolveForAllLocales && item.sys.locale) { | ||
delete item.sys.locale; | ||
} | ||
setLocalizedFieldGetters(item.fields, !!item.sys.locale); | ||
}); | ||
@@ -51,0 +56,0 @@ |
{ | ||
"name": "contentful", | ||
"version": "3.4.1", | ||
"version": "3.4.2", | ||
"description": "Client for Contentful's Content Delivery API", | ||
@@ -5,0 +5,0 @@ "homepage": "https://www.contentful.com/developers/documentation/content-delivery-api/", |
@@ -1,1 +0,1 @@ | ||
module.exports = '3.4.1' | ||
module.exports = '3.4.2' |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
510718
11945