From cf4d5d40c3bf53238020c4ee1d2a5a0ceddbb7b2 Mon Sep 17 00:00:00 2001 From: poignatov Date: Thu, 1 Jan 2026 19:25:04 +0300 Subject: [PATCH] Fix dictionary_id type mismatch in addWordsHandler (v2.0.7) --- VERSION | 2 +- play-life-backend/main.go | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 157e54f..f1547e6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.0.6 +2.0.7 diff --git a/play-life-backend/main.go b/play-life-backend/main.go index 889f341..52a59fe 100644 --- a/play-life-backend/main.go +++ b/play-life-backend/main.go @@ -917,8 +917,10 @@ func (a *App) addWordsHandler(w http.ResponseWriter, r *http.Request) { for i, wordReq := range req.Words { var id int dictionaryID := defaultDictID + var dictIDParam interface{} = nil if wordReq.DictionaryID != nil { dictionaryID = *wordReq.DictionaryID + dictIDParam = dictionaryID // Проверяем, что словарь принадлежит пользователю var dictUserID int err := tx.QueryRow(` @@ -939,7 +941,7 @@ func (a *App) addWordsHandler(w http.ResponseWriter, r *http.Request) { return } } - err := stmt.QueryRow(wordReq.Name, wordReq.Translation, wordReq.Description, wordReq.DictionaryID, dictionaryID, userID).Scan(&id) + err := stmt.QueryRow(wordReq.Name, wordReq.Translation, wordReq.Description, dictIDParam, dictionaryID, userID).Scan(&id) if err != nil { log.Printf("Error inserting word %d (name='%s', dict_id=%d, user_id=%d): %v", i, wordReq.Name, dictionaryID, userID, err) sendErrorWithCORS(w, err.Error(), http.StatusInternalServerError)