Skip to content

Commit

Permalink
Apply area code filter to LEs too
Browse files Browse the repository at this point in the history
  • Loading branch information
DQGriffin committed Jul 25, 2023
1 parent 3eb6ba9 commit a23fe0a
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,10 @@ const MigrateUsers = () => {
unassignedLEExtensions[index].data.phoneNumbers = phoneNumberMap.get(`${unassignedLEExtensions[index].data.id}`) || []
}

if (settings.shouldRestrictAreaCodes) {
unassignedLEExtensions = unassignedLEExtensions.filter((extension) => selectedAreaCodes.includes(extension.data.phoneNumbers![0].phoneNumber.substring(0, 5)))
}

const createdLEs = await createLEs(leBundles, unassignedLEExtensions, targetERLs, targetExts, availablePhoneNumbers)
targetExts = [...targetExts, ...createdLEs]

Expand Down

0 comments on commit a23fe0a

Please sign in to comment.