Files
NexaVPN/backend/internal/audit/handler.go
nessi 3289da24af refactor: update module path from github.com/nexavpn/nexavpn/backend to nexavpn/backend
Update go.mod module declaration and all internal imports across the backend codebase to use simplified nexavpn/backend path instead of full GitHub URL.
2026-03-15 16:42:25 +01:00

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)
}