~sircmpwn/meta.sr.ht

53efb3fe978e12aca652c77d47165b70c9eb52eb — Drew DeVault 3 months ago 9f731b1 0.56.15
API: Correct name of username constraint
1 files changed, 1 insertions(+), 1 deletions(-)

M api/graph/schema.resolvers.go
M api/graph/schema.resolvers.go => api/graph/schema.resolvers.go +1 -1
@@ 673,7 673,7 @@ func (r *mutationResolver) RegisterAccount(ctx context.Context, email string, us
			&user.Username, &user.Email, &user.UserTypeRaw); err != nil {
			if err, ok := err.(*pq.Error); ok &&
				err.Code == "23505" && // unique_violation
				err.Constraint == "ix_user_username" {
				err.Constraint == "user_username_unique" {
				valid.Error("This username is already in use.").
					WithField("username")
				return errors.New("placeholder") // To rollback the transaction