Development #287

Merged
bones7242 merged 58 commits from development into master 2017-12-11 20:53:02 +01:00
2 changed files with 7 additions and 11 deletions
Showing only changes of commit fe49f7e7de - Show all commits

View file

@ -177,15 +177,10 @@ module.exports = (sequelize, { STRING, BOOLEAN, INTEGER, TEXT, DECIMAL }) => {
where: {name, claimId},
})
.then(result => {
switch (result.length) {
case 0:
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]);
}
if (!result) {
return resolve(NO_CHANNEL);
};
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 => {
if (!result) {
return resolve(null);
};
switch (result.length) {
case 0:
return resolve(null);
case 1:
return resolve(result[0]);
default: