Skip to content

Commit dd7a281

Browse files
committed
updated packages to fix npm audit warnings, and tweaked account service update function
1 parent 62dc9a4 commit dd7a281

File tree

2 files changed

+46
-46
lines changed

2 files changed

+46
-46
lines changed

accounts/account.service.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,8 @@ async function create(params) {
183183
async function update(id, params) {
184184
const account = await getAccount(id);
185185

186-
// validate
187-
if (account.email !== params.email && await db.Account.findOne({ email: params.email })) {
186+
// validate (if email was changed)
187+
if (params.email && account.email !== params.email && await db.Account.findOne({ email: params.email })) {
188188
throw 'Email "' + params.email + '" is already taken';
189189
}
190190

package-lock.json

+44-44
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)