feat: tags autocomplete in page properties
This commit is contained in:
1 parent
a1e0e4f27a
commit
f4e3fd0954
5 files changed
+80
-7
No files matched your search
@@ -53,6 +53,10 @@ module.exports = class Tag extends Model {
|
||||
static async associateTags ({ tags, page }) {
|
||||
let existingTags = await WIKI.models.tags.query().column('id', 'tag')
|
||||
|
||||
// Format tags
|
||||
|
||||
tags = _.uniq(tags.map(t => t.toLowerCase()))
|
||||
|
||||
// Create missing tags
|
||||
|
||||
const newTags = _.filter(tags, t => !_.some(existingTags, ['tag', t])).map(t => ({
|
||||
|
||||
Reference in new issue
Block a user