fix: resolve core_handlers.go compilation errors and finalize HttpOnly implementation
This commit is contained in:
parent
31dabed7b9
commit
9a34d1d680
1 changed files with 4 additions and 9 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue