1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +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,6 +99,7 @@ class FeatureToggleStore {
} }
async getProjectId(name) { async getProjectId(name) {
if (name) {
return this.db return this.db
.first(['project']) .first(['project'])
.from(TABLE) .from(TABLE)
@ -109,6 +110,8 @@ class FeatureToggleStore {
return undefined; return undefined;
}); });
} }
return undefined;
}
async hasFeature(name) { async hasFeature(name) {
return this.db return this.db

View File

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