mirror of
https://github.com/TryGhost/Ghost.git
synced 2023-12-13 21:00:40 +01:00
refs #10124 - Author model returns only users that have published non-page posts - Added a public controller for tags (should be extracted to separate Content API controller https://github.com/TryGhost/Ghost/issues/10106) - Made resource configuration dynamic based on current theme engine - This needs a follow-up PR with fixes to the problems described in the PR
19 lines
431 B
JavaScript
19 lines
431 B
JavaScript
const ghostBookshelf = require('./base');
|
|
const tag = require('./tag');
|
|
|
|
const TagPublic = tag.Tag.extend({
|
|
shouldHavePosts: {
|
|
joinTo: 'tag_id',
|
|
joinTable: 'posts_tags'
|
|
}
|
|
});
|
|
|
|
const TagsPublic = ghostBookshelf.Collection.extend({
|
|
model: TagPublic
|
|
});
|
|
|
|
module.exports = {
|
|
TagPublic: ghostBookshelf.model('TagPublic', TagPublic),
|
|
TagsPublic: ghostBookshelf.collection('TagsPublic', TagsPublic)
|
|
};
|