big ole refactor
This commit is contained in:
@@ -15,7 +15,7 @@ import (
|
||||
// and also validates that they are different from each other
|
||||
func IsTeamShortNamesUnique(
|
||||
s *hws.Server,
|
||||
conn *bun.DB,
|
||||
conn *db.DB,
|
||||
) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
getter, err := validation.ParseForm(r)
|
||||
@@ -38,7 +38,7 @@ func IsTeamShortNamesUnique(
|
||||
}
|
||||
|
||||
var isUnique bool
|
||||
if ok := db.WithReadTx(s, w, r, conn, func(ctx context.Context, tx bun.Tx) (bool, error) {
|
||||
if ok := conn.WithReadTx(s, w, r, func(ctx context.Context, tx bun.Tx) (bool, error) {
|
||||
isUnique, err = db.TeamShortNamesUnique(ctx, tx, shortName, altShortName)
|
||||
if err != nil {
|
||||
return false, errors.Wrap(err, "db.TeamShortNamesUnique")
|
||||
|
||||
Reference in New Issue
Block a user