diff --git a/backend/internal/api/handlers/core_handlers.go b/backend/internal/api/handlers/core_handlers.go index 9c3313b..d6d8b54 100644 --- a/backend/internal/api/handlers/core_handlers.go +++ b/backend/internal/api/handlers/core_handlers.go @@ -2,13 +2,9 @@ package handlers import ( "encoding/json" - "errors" - "fmt" "net" "net/http" - "strconv" "strings" - "time" "github.com/rede5/gohorsejobs/backend/internal/api/middleware" "github.com/rede5/gohorsejobs/backend/internal/core/dto" @@ -211,7 +207,7 @@ func (h *CoreHandlers) CreateUser(w http.ResponseWriter, r *http.Request) { return } - resp, err := h.createUserUC.Execute(r.Context(), req) + resp, err := h.createUserUC.Execute(r.Context(), req, "") if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) return @@ -220,15 +216,14 @@ func (h *CoreHandlers) CreateUser(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json") w.WriteHeader(http.StatusCreated) json.NewEncoder(w).Encode(resp) -} + } -func (h *CoreHandlers) ListUsers(w http.ResponseWriter, r *http.Request) { - users, err := h.listUsersUC.Execute(r.Context(), "") + func (h *CoreHandlers) ListUsers(w http.ResponseWriter, r *http.Request) { + users, err := h.listUsersUC.Execute(r.Context(), "", 1, 100) if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) return } - w.Header().Set("Content-Type", "application/json") json.NewEncoder(w).Encode(users) }