Created
July 20, 2016 20:32
-
-
Save ivanoats/913bdb3f71df5177c20358e474fe4c13 to your computer and use it in GitHub Desktop.
createBlogPost.js
This file contains hidden or 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
const result = await space.createEntry('legacyPost', { | |
sys: { | |
createdAt: post.created_at, | |
updatedAt: post.updated_at, | |
}, | |
fields: { | |
title: { 'en-US': post.title }, | |
body: { 'en-US': post.body }, | |
slug: { 'en-US': post.slug }, | |
authorName: { 'en-US': post.author_name }, | |
intro: { 'en-US': post.intro }, | |
description: { 'en-US': post.description }, | |
scheduledPubTime: { 'en-US': post.scheduled_time }, | |
imageCredit: { 'en-US': post.image_credit }, | |
legacyFeaturedImageUrl: { | |
'en-US': `${assetHost}/blogs/${post.id}/featured_images/${post.featured_image_file_name}`, | |
}, | |
promotion: { | |
'en-US': { | |
sys: { | |
type: 'Link', | |
linkType: 'Entry', | |
id: promoId, | |
}, | |
}, | |
}, | |
}, | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment