more refactors :)
This commit is contained in:
@@ -76,7 +76,7 @@ func HasRole(ctx context.Context, tx bun.Tx, userID int, roleName roles.Role) (b
|
||||
Where("u.id = ?", userID).
|
||||
Scan(ctx)
|
||||
if err != nil {
|
||||
if err == sql.ErrNoRows {
|
||||
if errors.Is(err, sql.ErrNoRows) {
|
||||
return false, nil
|
||||
}
|
||||
return false, errors.Wrap(err, "tx.NewSelect")
|
||||
|
||||
Reference in New Issue
Block a user