fixed error in certificate validation

This commit is contained in:
bill bittner 2017-11-27 18:21:50 -08:00
parent 4d2cf09f37
commit fe49f7e7de
2 changed files with 7 additions and 11 deletions

View file

@ -177,15 +177,10 @@ module.exports = (sequelize, { STRING, BOOLEAN, INTEGER, TEXT, DECIMAL }) => {
where: {name, claimId},
})
.then(result => {
switch (result.length) {
case 0:
if (!result) {
return resolve(NO_CHANNEL);
case 1:
return resolve(result[0]);
default:
logger.warn(`more than one entry matches that name (${name}) and certificate Id (${claimId})`);
return resolve(result[0]);
}
};
resolve(claimId);
})
.catch(error => {
reject(error);

View file

@ -310,9 +310,10 @@ module.exports = (sequelize, { STRING, BOOLEAN, INTEGER, TEXT, DECIMAL }) => {
where: { name, claimId },
})
.then(result => {
switch (result.length) {
case 0:
if (!result) {
return resolve(null);
};
switch (result.length) {
case 1:
return resolve(result[0]);
default: