From d6167e10bac096eecdb301ddbb4a49a808008924 Mon Sep 17 00:00:00 2001 From: Benjamin Goering Date: Tue, 28 Feb 2017 23:57:35 +0800 Subject: [PATCH] Revert ALLOWED_TAGS declaration to be arr of objects, not strings --- services/comments.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/comments.js b/services/comments.js index 7820106ed..4b11f3622 100644 --- a/services/comments.js +++ b/services/comments.js @@ -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')); }