Skip to content

Commit

Permalink
fix: check if 'lineTypeIntelligence' property exists
Browse files Browse the repository at this point in the history
  • Loading branch information
vindard committed Dec 27, 2023
1 parent 50c87f5 commit ccbc61f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/api/src/services/twilio-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ export const TwilioClient = (): IPhoneProviderService => {
fields: "line_type_intelligence",
})
// https://www.twilio.com/docs/lookup/v2-api/line-type-intelligence#type-property-values
if (!lookup.lineTypeIntelligence) {
return new InvalidTypePhoneProviderError("type not found")
}
if (lookup.lineTypeIntelligence.type === "nonFixedVoip") {
return new InvalidTypePhoneProviderError("nonFixedVoip")
}
Expand Down

0 comments on commit ccbc61f

Please sign in to comment.