Update go.mod module declaration and all internal imports across the backend codebase to use simplified nexavpn/backend path instead of full GitHub URL.
26 lines
487 B
Go
26 lines
487 B
Go
package audit
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"nexavpn/backend/internal/apiutil"
|
|
)
|
|
|
|
type Handler struct {
|
|
service *Service
|
|
}
|
|
|
|
func NewHandler(service *Service) *Handler {
|
|
return &Handler{service: service}
|
|
}
|
|
|
|
func (h *Handler) List(w http.ResponseWriter, r *http.Request) {
|
|
items, err := h.service.List(r.Context(), 100)
|
|
if err != nil {
|
|
apiutil.Error(w, http.StatusInternalServerError, "audit_list_failed", "unable to list audit logs")
|
|
return
|
|
}
|
|
|
|
apiutil.JSON(w, http.StatusOK, items)
|
|
}
|