From 06ee73a7da331b1cc28d293294a791aff0bb13de Mon Sep 17 00:00:00 2001 From: Dave Landry Date: Wed, 9 Jan 2019 15:57:39 -0500 Subject: [PATCH] makes image endpoint work with slugs --- api/profileImage.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api/profileImage.js b/api/profileImage.js index 5727adcd6..fa8ee8459 100644 --- a/api/profileImage.js +++ b/api/profileImage.js @@ -1,4 +1,5 @@ -const axios = require("axios"); +const axios = require("axios"), + sequelize = require("sequelize"); const {CANON_LOGICLAYER_CUBE} = process.env; @@ -28,7 +29,7 @@ module.exports = function(app) { } - db.search.findOne({where: {id: pid, dimension: slugMap[pslug]}}) + db.search.findOne({where: {[sequelize.Op.or]: {id: pid, slug: pid}, dimension: slugMap[pslug]}}) .then(attr => { if (!attr) sendImage(false);