Refacotor: Added repository interface to cover UserRepository dependency

This commit is contained in:
PB
2025-10-24 10:25:38 +02:00
parent 5540e02644
commit 44edb080d8
15 changed files with 112 additions and 83 deletions

View File

@@ -6,6 +6,7 @@ import (
"fmt"
entity "git.ego.freeddns.org/egommerce/api-entities/identity/entity"
"git.ego.freeddns.org/egommerce/go-api-pkg/database"
"github.com/jackc/pgx/v5/pgxpool"
@@ -86,6 +87,7 @@ func (r *URLAccessRepository) FindByURLAndServiceForRole(url, service, role stri
err := r.db.QueryRow(context.Background(), sql, url, service).
Scan(&entity.ID, &entity.Roles, &entity.URL, &entity.Service)
if err != nil {
fmt.Println(sql, url, service, role)
if err = database.NoRowsInQuerySet(err); err != nil {
return nil, errors.New("no url found for: " + url + " and role: " + role)
}