Revert ALLOWED_TAGS declaration to be arr of objects, not strings

This commit is contained in:
Benjamin Goering
2017-02-28 23:57:35 +08:00
parent 32152fee7e
commit d6167e10ba
+3 -3
View File
@@ -4,8 +4,8 @@ const ActionModel = require('../models/action');
const ActionsService = require('./actions');
const ALLOWED_TAGS = [
'STAFF',
'BEST',
{name: 'STAFF'},
{name: 'BEST'},
];
const STATUSES = [
@@ -53,7 +53,7 @@ module.exports = class CommentsService {
*/
static addTag(id, name, assigned_by) {
if (ALLOWED_TAGS.find((t) => t === name) == null) {
if (ALLOWED_TAGS.find((t) => t.name === name) == null) {
return Promise.reject(new Error('tag not allowed'));
}