Skip to content

Commit

Permalink
Save phone number as user if new user.
Browse files Browse the repository at this point in the history
  • Loading branch information
param108 committed Feb 24, 2024
1 parent 098ad1c commit d034770
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions api/spgroups/spgroups.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,12 @@ func CreateAddGroupUserHandler(db store.Store) http.HandlerFunc {
return
}

// If the user doesnt exist just save the phone number as the name
if user.Name == "" {
user.Name = req.Phone
db.UpdateSPUser(user)
}

newGrpUser := models.SpGroupUser{
SpGroupID: req.GroupID,
SpUserID: user.ID,
Expand Down

0 comments on commit d034770

Please sign in to comment.