mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-19 00:11:49 +03:00
397400b4f8
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
15 lines
367 B
JavaScript
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;
|