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
+2 -4
View File
@@ -1,6 +1,4 @@
BB=bb_api
all: bb
all: bb api_bb_logs
git:
git pull
@@ -11,7 +9,7 @@ stop_bb:
build_bb:
docker compose build api_bb --no-cache
bb: git stop_bb build_bb bbb api_bb_logs
bb: git stop_bb build_bb bbb
docker compose up api_bb -d
bb_db:
@@ -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")