refactor: remove redundant validation and unused import

This commit is contained in:
2026-01-10 22:41:43 +01:00
parent b6f5293c0f
commit a1e63b868f

View File

@@ -12,7 +12,6 @@ import (
"goyco/internal/repositories"
"goyco/internal/security"
"goyco/internal/services"
"goyco/internal/validation"
"github.com/go-chi/chi/v5"
"github.com/jackc/pgconn"
@@ -273,16 +272,6 @@ func (h *PostHandler) UpdatePost(w http.ResponseWriter, r *http.Request) {
title := security.SanitizeInput(req.Title)
content := security.SanitizePostContent(req.Content)
if err := validation.ValidateTitle(title); err != nil {
SendErrorResponse(w, err.Error(), http.StatusBadRequest)
return
}
if err := validation.ValidateContent(content); err != nil {
SendErrorResponse(w, err.Error(), http.StatusBadRequest)
return
}
post.Title = title
post.Content = content