Skip to content

Commit

Permalink
feat(10dlc): support multiple numbers per sending location
Browse files Browse the repository at this point in the history
  • Loading branch information
ajohn25 committed Mar 4, 2024
1 parent 4c05c44 commit f5ec861
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/lib/process-message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,13 @@ export const getNumberForSendingLocation = async (
from sms.phone_numbers pn
join sms.sending_locations sl on sl.id = pn.sending_location_id
where sl.id = $1
limit 2
order by random()
limit 1
`,
[sendingLocationId]
);

if (rowCount !== 1) {
if (rowCount < 1) {
// TODO: throw new Incorrect10DlcNumberCountError
throw new Error(`Incorrect10DlcNumberCountError: Sending Location
${sendingLocationId}`);
Expand Down

0 comments on commit f5ec861

Please sign in to comment.