-
-
Save jazibsawar/5430f8ceba6378787540d790141edb91 to your computer and use it in GitHub Desktop.
src/resources/BlogFeed.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import _map from 'lodash.map' | |
export default { | |
feed() { | |
return { | |
path: '/object-type/posts', | |
resolve: (response, mappers) => { | |
let _posts = _map(response.objects, function(i) { | |
let temp = { | |
title: i.title, | |
image: i.metadata.image.imgix_url, | |
published: i.created_at, | |
author: i.metadata.author.title, | |
id: i.slug | |
}; | |
return temp; | |
}) | |
return mappers.pipe(_posts) | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment