File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
packages/services/api/src/modules/support/providers Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -218,7 +218,7 @@ export class SupportManager {
218
218
219
219
// Before attempting to create the user we need to check whether an user with that email might already exist.
220
220
let userZendeskId = await this . httpClient
221
- . get ( `https://${ this . config . subdomain } .zendesk.com/api/v2/users` , {
221
+ . get ( `https://${ this . config . subdomain } .zendesk.com/api/v2/users/search ` , {
222
222
searchParams : {
223
223
query : email ,
224
224
} ,
@@ -242,9 +242,9 @@ export class SupportManager {
242
242
} )
243
243
. parse ( res ) ;
244
244
245
- const user = data . users . at ( 0 ) ?? null ;
245
+ const user = data . users . find ( u => u . email === email ) ?? null ;
246
246
247
- if ( user ?. email === email ) {
247
+ if ( user ) {
248
248
this . logger . info (
249
249
'User found on Zendesk. (organizationID: %s, userId: %s)' ,
250
250
input . organizationId ,
You can’t perform that action at this time.
0 commit comments