refactor: ahora los repos se acceden con un singleton en vez de inyecion

de dependencias
This commit is contained in:
fede committed 2026-06-14 02:58:56 -03:00
1 parent 52fc779abd
commit 141715ee0a
22 files changed
+244 -211

No files matched your search

+2 -1
View File
@@ -6,6 +6,7 @@ import (
"repuestera_back/dto"
"repuestera_back/jwtutils"
r "repuestera_back/repositorios"
"github.com/gin-gonic/gin"
"github.com/golang-jwt/jwt/v5"
@@ -42,7 +43,7 @@ func Refresh(c *gin.Context) {
c.JSON(http.StatusUnauthorized, gin.H{"error": "invalid token claims"})
return
}
user, err := usuarioRepo.ObtenerPorID(uint(sub))
user, err := r.ObtenerRepositorios().Usuario.ObtenerPorID(uint(sub))
if err != nil {
c.JSON(http.StatusNotFound, gin.H{"error": "user not found"})
return