refactor(api): move postgres error handling into a separate function in a separate file

This commit is contained in:
2025-01-06 03:53:08 +03:00
parent c7df4a1960
commit 9a0b81fba3
3 changed files with 26 additions and 35 deletions
-9
View File
@@ -7,7 +7,6 @@ import (
"time"
"github.com/H1K0/SkazaNull/models"
"github.com/jackc/pgx/v5/pgconn"
"github.com/jackc/pgx/v5/pgxpool"
)
@@ -31,14 +30,6 @@ func InitDB(connString string) error {
return nil
}
func CastToPgError(err error) *pgconn.PgError {
pqErr, ok := err.(*pgconn.PgError)
if ok {
return pqErr
}
return nil
}
//#region User
func UserAuth(ctx context.Context, login string, password string) (user models.User, err error) {