modified: serv_nginx/Makefile

modified:   serv_nginx/api_bb/internal/handlers/news_handler.go
This commit is contained in:
2025-10-16 09:48:34 +05:00
parent a085b9b8b7
commit 5d549c2079
2 changed files with 3 additions and 4 deletions
@@ -79,6 +79,7 @@ func (h *NewsHandler) GetNewsByID(w http.ResponseWriter, r *http.Request) {
func (h *NewsHandler) CreateNews(w http.ResponseWriter, r *http.Request) {
logger.Get().Debug("Start CreateNews Method")
userID, ok := r.Context().Value(middleware.UserIDKey).(uint)
logger.Get().Info("userID", zap.Uint("userID", userID))
if !ok {
fmt.Printf("userid %d", userID)
utils.RespondWithError(w, http.StatusUnauthorized, "Unauthorized")