From f25a0b6110b52d1a5b251e924f9c0df6ead3ae7c Mon Sep 17 00:00:00 2001 From: Pete Stein Date: Wed, 20 Jul 2016 15:32:10 -0400 Subject: [PATCH 1/2] Updates client calls to .getEntries() and .getContentType instead of .entries() and .contentType(), both of which do not seem to have been supported in Contentful.js since 3.x/April 2016. --- lib/index.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/index.coffee b/lib/index.coffee index 28c2bbb..b966a70 100644 --- a/lib/index.coffee +++ b/lib/index.coffee @@ -63,7 +63,7 @@ module.exports = (opts) -> if not t.id then return W.reject(errors.no_type_id) t.filters ?= {} if (not t.name || (t.template && not t.path)) - return W client.contentType(t.id).then (res) -> + return W client.getContentType(t.id).then (res) -> t.name ?= pluralize(S(res.name).toLowerCase().underscore().s) if t.template t.path ?= (e) -> "#{t.name}/#{S(e[res.displayField]).slugify().s}" @@ -105,7 +105,7 @@ module.exports = (opts) -> fetch_content = (type) -> W( - client.entries( + client.getEntries( _.merge(type.filters, content_type: type.id, include: 10) ) ) From c3c21ec406eac33c62a93b0eb633ece8cbc9eea8 Mon Sep 17 00:00:00 2001 From: Pete Stein Date: Mon, 1 Aug 2016 17:40:28 -0400 Subject: [PATCH 2/2] getEntries() is no longer an array of entries, but rather an object with an items member that is an array of entries. --- lib/index.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/index.coffee b/lib/index.coffee index b966a70..3700fcc 100644 --- a/lib/index.coffee +++ b/lib/index.coffee @@ -116,7 +116,7 @@ module.exports = (opts) -> * @return {Promise} - returns formatted content type entries object ### - format_content = (content) -> W.map(content, format_entry) + format_content = (content) -> W.map(content.items, format_entry) ###* * Formats a single entry object from Contentful API response