modified: serv_nginx/Makefile
modified: serv_nginx/api_bb/internal/handlers/news_handler.go
This commit is contained in:
+2
-4
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user