Skip to content
Open
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
4 changes: 2 additions & 2 deletions src/contenttype-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class FetchSpecifiedContentTypes extends FetchContentTypes {
const contentTypes = await fn.apply(null, [url, config, responseKey, query]);

const referredContentTypes = new ReferredContentTypes();
const referredContentTypesList = referredContentTypes.getReferredContentTypes(contentTypes);
const referredContentTypesList = referredContentTypes.getReferredContentTypes(contentTypes);

let referredContentTypesData = [];
if (referredContentTypesList.length) {
Expand All @@ -49,7 +49,7 @@ class FetchUnspecifiedContentTypes extends FetchContentTypes {
const contentTypes = await fn.apply(null, [url, config, responseKey, query]);

const referredContentTypes = new ReferredContentTypes();
const referredContentTypesList = referredContentTypes.getReferredContentTypes(contentTypes);
const referredContentTypesList = referredContentTypes.getReferredContentTypes(contentTypes).filter((uid) => !(config.excludeContentTypes || []).includes(uid));

let referredContentTypesData = [];
if (referredContentTypesList.length) {
Expand Down
8 changes: 4 additions & 4 deletions src/entry-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class FetchDefaultEntries extends FetchEntries {
const assetTokenKey = `${typePrefix.toLowerCase()}-sync-token-asset-${configOptions.api_key}`;
const [syncEntryToken, syncAssetToken] = await Promise.all([cache.get(entryTokenKey), cache.get(assetTokenKey)])


const syncEntryParams = syncEntryToken
? { sync_token: syncEntryToken }
: { init: true, limit: configOptions.limit > 100 ? 50 : configOptions.limit };
Expand Down Expand Up @@ -72,7 +72,7 @@ class FetchSpecifiedContentTypesEntries extends FetchEntries {
try {
let syncData = {};
const typePrefix = configOptions.type_prefix || 'Contentstack';
const contentTypes = await cache.get(typePrefix);
const contentTypes = (await cache.get(typePrefix) || []).filter((ct) => !(configOptions.excludeContentTypes || []).includes(ct.uid));

for (let i = 0; i < contentTypes.length; i++) {
const contentType = contentTypes[i].uid;
Expand Down Expand Up @@ -172,9 +172,9 @@ class FetchSpecifiedLocalesAndContentTypesEntries extends FetchEntries {
try {
let syncData = {};
const typePrefix = configOptions.type_prefix || 'Contentstack';
const contentTypes = await cache.get(typePrefix);
const contentTypes = (await cache.get(typePrefix) || []).filter((ct) => !(configOptions.excludeContentTypes || []).includes(ct.uid));
const locales = configOptions.locales;

for (let i = 0; i < contentTypes.length; i++) {
const contentType = contentTypes[i].uid;
for (let j = 0; j < locales.length; j++) {
Expand Down