fleet/website/api/controllers/view-pricing.js
Eric d92d9980ce
Website: Build pricing page from yaml file (#8549)
* Create pricing-features-table.yml

* update built-static-content to add the pricing table configuration to builtStaticContent

* Update pricing page to use builtStaticContent.pricingTable

* Update view-pricing.js

* update pricing table, lint fix

Co-authored-by: Mike McNeil <[email protected]>
2022-12-05 14:11:46 -06:00

36 lines
581 B
JavaScript
Vendored

module.exports = {
friendlyName: 'View pricing',
description: 'Display "Pricing" page.',
exits: {
success: {
viewTemplatePath: 'pages/pricing'
},
badConfig: {
responseType: 'badConfig'
},
},
fn: async function () {
if(!_.isObject(sails.config.builtStaticContent) || !_.isArray(sails.config.builtStaticContent.pricingTable)) {
throw {badConfig: 'builtStaticContent.pricingTable'};
}
let pricingTable = sails.config.builtStaticContent.pricingTable;
// Respond with view.
return { pricingTable };
}
};