Private
Public Access
refactor: ahora los repos se acceden con un singleton en vez de inyecion
de dependencias
This commit is contained in:
1 parent
52fc779abd
commit
141715ee0a
22 files changed
+244
-211
No files matched your search
@@ -7,6 +7,7 @@ import (
|
||||
|
||||
"repuestera_back/dto"
|
||||
"repuestera_back/jwtutils"
|
||||
r "repuestera_back/repositorios"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/golang-jwt/jwt/v5"
|
||||
@@ -50,7 +51,7 @@ func Me(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
userID, _ := strconv.ParseUint(sub, 10, 32)
|
||||
user, err := usuarioRepo.ObtenerPorID(uint(userID))
|
||||
user, err := r.ObtenerRepositorios().Usuario.ObtenerPorID(uint(userID))
|
||||
if err != nil {
|
||||
c.JSON(http.StatusNotFound, gin.H{"error": "user not found"})
|
||||
return
|
||||
|
||||
Reference in new issue
Block a user