feat: use six-digit numeric member invite codes
This commit is contained in:
@@ -67,6 +67,9 @@ func (s *Store) RegisterAccount(ctx context.Context, input AccountRegistration)
|
||||
levelID, parentID, teamLevel, tree, input.InviteCode)
|
||||
if err != nil {
|
||||
if isDuplicate(err) {
|
||||
if strings.Contains(err.Error(), "uk_app_member_invite_code") {
|
||||
return nil, ErrInviteCodeExists
|
||||
}
|
||||
return nil, ErrAccountExists
|
||||
}
|
||||
return nil, err
|
||||
|
||||
@@ -4,6 +4,7 @@ import "errors"
|
||||
|
||||
var (
|
||||
ErrAccountExists = errors.New("account already exists")
|
||||
ErrInviteCodeExists = errors.New("invite code already exists")
|
||||
ErrAccountNotFound = errors.New("account not found")
|
||||
ErrAccountRestricted = errors.New("account restricted")
|
||||
ErrAttachmentInvalid = errors.New("attachment invalid")
|
||||
|
||||
Reference in New Issue
Block a user