Skip to content

Commit

Permalink
makes image endpoint work with slugs
Browse files Browse the repository at this point in the history
  • Loading branch information
davelandry committed Jan 9, 2019
1 parent 2af5ea7 commit 06ee73a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions api/profileImage.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const axios = require("axios");
const axios = require("axios"),
sequelize = require("sequelize");

const {CANON_LOGICLAYER_CUBE} = process.env;

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 06ee73a

Please sign in to comment.