Finalized Contentful product sync

This commit is contained in:
olivermrbl
2020-07-02 14:22:41 +02:00
parent 3cf295b79a
commit f9476da6d6
4 changed files with 38 additions and 32 deletions
@@ -2,16 +2,17 @@ export default async (req, res) => {
try {
const contentfulService = req.scope.resolve("contentfulService")
const contentfulType = req.body.contentType.sys.id
const contentfulType = req.body.sys.contentType.sys.id
const entryId = req.body.sys.id
let updated = {}
switch (contentfulType) {
case "product":
updated = await contentfulService.sendContentfulProductToAdmin(req.body)
updated = await contentfulService.sendContentfulProductToAdmin(entryId)
break
case "productVariant":
updated = await contentfulService.sendContentfulProductVariantToAdmin(
req.body
entryId
)
break
default: