Don't bonk when we have no E164s
This commit is contained in:
parent
a1aee10412
commit
e8f899d098
2 changed files with 4 additions and 1 deletions
|
|
@ -41,6 +41,9 @@ func PhoneFromE164(ctx context.Context, txn db.Ex, e164 string) (model.Phone, er
|
|||
return db.ExecuteOneTx[model.Phone](ctx, txn, statement)
|
||||
}
|
||||
func PhonesFromE164s(ctx context.Context, txn db.Ex, e164s []string) ([]model.Phone, error) {
|
||||
if len(e164s) == 0 {
|
||||
return []model.Phone{}, nil
|
||||
}
|
||||
sql_ids := make([]postgres.Expression, len(e164s))
|
||||
for i, e164 := range e164s {
|
||||
sql_ids[i] = postgres.String(e164)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue