modified: serv_nginx/api_bb/internal/handlers/news_handler.go

add start end to CreateNews method
This commit is contained in:
2025-10-16 09:41:05 +05:00
parent 4f123ed399
commit a085b9b8b7
@@ -77,6 +77,7 @@ func (h *NewsHandler) GetNewsByID(w http.ResponseWriter, r *http.Request) {
// CreateNews создает новую новость
func (h *NewsHandler) CreateNews(w http.ResponseWriter, r *http.Request) {
logger.Get().Debug("Start CreateNews Method")
userID, ok := r.Context().Value(middleware.UserIDKey).(uint)
if !ok {
fmt.Printf("userid %d", userID)
@@ -141,6 +142,7 @@ func (h *NewsHandler) UpdateNews(w http.ResponseWriter, r *http.Request) {
return
}
logger.Get().Debug("End CreateNews Method")
utils.RespondWithJSON(w, http.StatusOK, news)
}