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

Commit

Permalink
1426 add cmsPageIdentifier endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
anqaka committed Jul 16, 2018
1 parent a1c2434 commit b0d8064
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 @@ -38,5 +38,21 @@ module.exports = ({ config, db }) => {
})
})

cmsApi.get('/cmsPageIdentifier/:identifier/storeId/:storeId', (req, res) => {
const client = Magento2Client(config.magento2.api);
client.addMethods('cmsPageIdentifier', function (restClient) {
let module = {};
module.getPageIdentifier = function () {
return restClient.get(`/snowdog/cmsPageIdentifier/${req.params.identifier}/storeId/${req.params.storeId}`);
}
return module;
})
client.cmsPageIdentifier.getPageIdentifier().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 b0d8064

Please sign in to comment.