Skip to content

Commit

Permalink
Remove scheme from path
Browse files Browse the repository at this point in the history
  • Loading branch information
Robi9 committed Oct 21, 2024
1 parent 2ce49f8 commit 5ffa072
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions backends/rapidpro/urn.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"database/sql"
"database/sql/driver"
"fmt"
"strings"

"github.com/nyaruka/null"

Expand Down Expand Up @@ -299,7 +300,7 @@ UPDATE
contacts_contacturn
SET
identity = $1,
path = $1
path = $3
WHERE
id = $2;
Expand Down Expand Up @@ -336,7 +337,8 @@ func fullyUpdateContactURN(db *sqlx.Tx, urn *DBContactURN) error {
}

func updateContactTeamsURN(ctx context.Context, db *sqlx.DB, urnID ContactURNID, newURN string) error {
_, err := db.ExecContext(ctx, updateTeamsURN, newURN, urnID)
path := strings.TrimPrefix(newURN, "teams:")
_, err := db.ExecContext(ctx, updateTeamsURN, newURN, urnID, path)
if err != nil {
logrus.WithError(err).WithField("urn_id", urnID).Error("error updating contact urn")
return err
Expand Down

0 comments on commit 5ffa072

Please sign in to comment.