feat: tags autocomplete in page properties

This commit is contained in:
NGPixel committed 2020-02-02 16:24:27 -05:00
1 parent a1e0e4f27a
commit f4e3fd0954
5 files changed
+80 -7

No files matched your search

+4
View File
@@ -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 => ({