Ghost/core/server/data/meta/keywords.js
Katharina Irrgang 397400b4f8
Moved visibility utility to static model fn (#9327)
refs #9178

- this logic belongs to a static model helper
- the visibility property is a model property, the knowledge about the visibility values belongs to the model
- rename the functions, so they make more sense
2017-12-13 13:19:51 +01:00

15 lines
367 B
JavaScript

'use strict';
const models = require('../../models');
function getKeywords(data) {
if (data.post && data.post.tags && data.post.tags.length > 0) {
return models.Base.Model.filterByVisibility(data.post.tags, ['public'], false, function processItem(item) {
return item.name;
});
}
return null;
}
module.exports = getKeywords;