fleet/website/api/controllers/view-infrastructure-as-code.js

41 lines
892 B
JavaScript
Raw Normal View History

module.exports = {
friendlyName: 'View infrastructure-as-code',
description: 'Display "Fleet infrastructure-as-code" page.',
exits: {
success: {
viewTemplatePath: 'pages/infrastructure-as-code'
},
badConfig: {
responseType: 'badConfig'
},
},
fn: async function () {
if (!_.isObject(sails.config.builtStaticContent) || !_.isArray(sails.config.builtStaticContent.testimonials) || !sails.config.builtStaticContent.compiledPagePartialsAppPath) {
throw {badConfig: 'builtStaticContent.testimonials'};
}
// Get testimonials for the <scrolalble-tweets> component.
let testimonialsForScrollableTweets = _.uniq(_.clone(sails.config.builtStaticContent.testimonials), (quote)=>{
return quote.quoteAuthorName.toLowerCase();
});
// Respond with view.
return {
testimonialsForScrollableTweets
};
}
};