fixed error in certificate validation
This commit is contained in:
parent
4d2cf09f37
commit
fe49f7e7de
2 changed files with 7 additions and 11 deletions
|
@ -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);
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue