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}, where: {name, claimId},
}) })
.then(result => { .then(result => {
switch (result.length) { if (!result) {
case 0: return resolve(NO_CHANNEL);
return resolve(NO_CHANNEL); };
case 1: resolve(claimId);
return resolve(result[0]);
default:
logger.warn(`more than one entry matches that name (${name}) and certificate Id (${claimId})`);
return resolve(result[0]);
}
}) })
.catch(error => { .catch(error => {
reject(error); reject(error);

View file

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