From 0bb53d82955213380f54452ba21245a458524100 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benedikt=20R=C3=B6tsch?= Date: Tue, 20 Feb 2018 13:11:08 +0100 Subject: [PATCH] refactor(contentful): only include till the level we actually need --- services/contentful.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/services/contentful.js b/services/contentful.js index f9f4413..aae4649 100644 --- a/services/contentful.js +++ b/services/contentful.js @@ -75,7 +75,7 @@ module.exports.getCourses = throwOnEmptyResult('Course', (locale = 'en-US', api content_type: 'course', locale, order: '-sys.createdAt', // Ordering the entries by creation date - include: 6 // We use include param to increase the link level, the include value goes from 1 to 6 + include: 1 // We use include param to increase the link level, the include value goes from 1 to 6 }) .then((response) => response.items) }) @@ -94,7 +94,7 @@ module.exports.getLandingPage = (slug, locale = 'en-US', api = 'cda') => { content_type: 'layout', locale, 'fields.slug': slug, - include: 6 + include: 3 }) .then((response) => response.items[0]) } @@ -113,7 +113,7 @@ module.exports.getCourse = throwOnEmptyResult('Course', (slug, locale = 'en-US', content_type: 'course', 'fields.slug': slug, locale, - include: 6 + include: 2 }) .then((response) => response.items[0]) }) @@ -139,7 +139,7 @@ module.exports.getCoursesByCategory = throwOnEmptyResult('Category', (category, 'fields.categories.sys.id': category, locale, order: '-sys.createdAt', - include: 6 + include: 1 }) .then((response) => response.items) })