Skip to content

Commit

Permalink
Merge pull request #12981 from mozilla/FXA-4791-slow-auto-complete-on…
Browse files Browse the repository at this point in the history
…-account-search

fix(admin-panel): Fix slow autocomplete in account search
  • Loading branch information
dschom authored May 23, 2022
2 parents b884dd7 + 59051ba commit f042a9f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/fxa-admin-server/src/gql/account/account.resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export class AccountResolver {
.query()
.select(ACCOUNT_COLUMNS.map((c) => 'accounts.' + c))
.innerJoin('emails', 'emails.uid', 'accounts.uid')
.where('emails.normalizedEmail', email)
.where('emails.normalizedEmail', email.toLocaleLowerCase())
.first();
}

Expand All @@ -120,7 +120,7 @@ export class AccountResolver {
return this.db.emails
.query()
.select(EMAIL_COLUMNS)
.where('email', 'like', `${search}%`)
.where('normalizedEmail', 'like', `${search.toLowerCase()}%`)
.limit(10);
}

Expand All @@ -130,7 +130,7 @@ export class AccountResolver {
public async unverifyEmail(@Args('email') email: string) {
const result = await this.db.emails
.query()
.where('email', email)
.where('normalizedEmail', 'like', `${email.toLowerCase()}%`)
.update({
isVerified: false,
verifiedAt: null as any, // same as null
Expand Down

0 comments on commit f042a9f

Please sign in to comment.