mirror of
https://github.com/wassname/talk.git
synced 2026-07-08 05:39:25 +08:00
fix: fixes #1867
This commit is contained in:
+8
-3
@@ -5,7 +5,6 @@ const Assets = require('./assets');
|
||||
const Settings = require('./settings');
|
||||
const { ADD_COMMENT_TAG } = require('../perms/constants');
|
||||
const { ErrNotAuthorized } = require('../errors');
|
||||
const { get, has } = require('lodash');
|
||||
|
||||
const updateModel = async (item_type, query, update) => {
|
||||
// Get the model to update with.
|
||||
@@ -60,8 +59,14 @@ class TagsService {
|
||||
asset = await Assets.findById(id);
|
||||
}
|
||||
|
||||
if (asset && has(asset, 'settings.tags')) {
|
||||
return get(asset, 'settings.tags');
|
||||
// FIXME: comments ...
|
||||
if (
|
||||
asset &&
|
||||
asset.settings &&
|
||||
asset.settings.tags &&
|
||||
Array.isArray(asset.settings.tags)
|
||||
) {
|
||||
return asset.settings.tags;
|
||||
}
|
||||
|
||||
// Extract the tags from the settings object.
|
||||
|
||||
Reference in New Issue
Block a user