Skip to content

Commit 8a0b6a6

Browse files
committed
wip: fix lint
1 parent f23f0ea commit 8a0b6a6

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

meteor/__mocks__/suppressLogging.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export class SupressLogMessages {
4040
static expectAllMessagesToHaveBeenHandled(): void {
4141
const unhandledSuppressMessages = [...SupressLogMessages.suppressMessages]
4242
SupressLogMessages.suppressMessages.length = 0
43+
// eslint-disable-next-line jest/no-standalone-expect
4344
expect(unhandledSuppressMessages).toHaveLength(0)
4445
}
4546
}

meteor/server/api/blueprints/__tests__/migrationContext.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import '../../../../__mocks__/_extendJest'
2-
import * as _ from 'underscore'
32
import { setupDefaultStudioEnvironment } from '../../../../__mocks__/helpers/database'
43
import { literal, unprotectString } from '../../../lib/tempLib'
54
import {

meteor/server/api/user.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { Meteor } from 'meteor/meteor'
2-
import * as _ from 'underscore'
32
import { Accounts } from 'meteor/accounts-base'
43
import { unprotectString, protectString } from '../lib/tempLib'
54
import { sleep, deferAsync } from '../lib/lib'
@@ -25,7 +24,7 @@ async function enrollUser(email: string, name: string): Promise<UserId> {
2524
profile: { name: name },
2625
})
2726
try {
28-
Accounts.sendEnrollmentEmail(unprotectString(id), email)
27+
await Accounts.sendEnrollmentEmail(unprotectString(id), email)
2928
} catch (error) {
3029
logger.error('Accounts.sendEnrollmentEmail')
3130
logger.error(error)
@@ -63,11 +62,13 @@ async function sendVerificationEmail(userId: UserId) {
6362
const user = await Users.findOneAsync(userId)
6463
if (!user) throw new Meteor.Error(404, `User "${userId}" not found!`)
6564
try {
66-
_.each(user.emails, (email) => {
67-
if (!email.verified) {
68-
Accounts.sendVerificationEmail(unprotectString(user._id), email.address)
69-
}
70-
})
65+
await Promise.all(
66+
user.emails.map(async (email) => {
67+
if (!email.verified) {
68+
await Accounts.sendVerificationEmail(unprotectString(user._id), email.address)
69+
}
70+
})
71+
)
7172
} catch (error) {
7273
logger.error('ERROR sending email verification')
7374
logger.error(error)
@@ -79,7 +80,7 @@ async function requestResetPassword(email: string): Promise<boolean> {
7980
const meteorUser = Accounts.findUserByEmail(email) as unknown
8081
const user = meteorUser as User
8182
if (!user) return false
82-
Accounts.sendResetPasswordEmail(unprotectString(user._id))
83+
await Accounts.sendResetPasswordEmail(unprotectString(user._id))
8384
return true
8485
}
8586

0 commit comments

Comments
 (0)