Skip to content
This repository has been archived by the owner on May 28, 2023. It is now read-only.

Commit

Permalink
1426 add cmsBlockIdentifier endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
anqaka committed Jul 18, 2018
1 parent b0d8064 commit 7f7ed7c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/api/extensions/cms-data/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,21 @@ module.exports = ({ config, db }) => {
})
})

cmsApi.get('/cmsBlockIdentifier/:identifier/storeId/:storeId', (req, res) => {
const client = Magento2Client(config.magento2.api);
client.addMethods('cmsBlockIdentifier', function (restClient) {
let module = {};
module.getBlockIdentifier = function () {
return restClient.get(`/snowdog/cmsBlockIdentifier/${req.params.identifier}/storeId/${req.params.storeId}`);
}
return module;
})
client.cmsBlockIdentifier.getBlockIdentifier().then((result) => {
apiStatus(res, result, 200); // just dump it to the browser, result = JSON object
}).catch(err => {
apiStatus(res, err, 500);
})
})

return cmsApi
}

0 comments on commit 7f7ed7c

Please sign in to comment.