1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-11 00:08:30 +01:00

fix: emailservice now just returns if email was configured

This commit is contained in:
Christopher Kolstad 2021-04-23 15:24:32 +02:00
parent 7cb7e4a193
commit 97d77d84cc
2 changed files with 14 additions and 15 deletions

View File

@ -99,15 +99,18 @@ class FeatureToggleStore {
}
async getProjectId(name) {
return this.db
.first(['project'])
.from(TABLE)
.where({ name })
.then(r => (r ? r.project : undefined))
.catch(e => {
this.logger.error(e);
return undefined;
});
if (name) {
return this.db
.first(['project'])
.from(TABLE)
.where({ name })
.then(r => (r ? r.project : undefined))
.catch(e => {
this.logger.error(e);
return undefined;
});
}
return undefined;
}
async hasFeature(name) {

View File

@ -108,9 +108,8 @@ export default class UserAdminController extends Controller {
);
const emailConfigured = this.emailService.configured();
let sentMetaData = null;
if (emailConfigured) {
sentMetaData = await this.emailService.sendGettingStartedMail(
await this.emailService.sendGettingStartedMail(
createdUser.name,
createdUser.email,
inviteLink.toString(),
@ -121,13 +120,10 @@ export default class UserAdminController extends Controller {
);
}
const emailSent =
sentMetaData?.response.includes(MAIL_ACCEPTED) || false;
res.status(201).send({
...createdUser,
inviteLink,
emailSent,
emailSent: emailConfigured,
rootRole,
});
} catch (e) {