From dc31d4edb4012460a7a2f9cc6f5e9176477143ec Mon Sep 17 00:00:00 2001 From: prokopparuzek Date: Thu, 23 Oct 2025 10:27:15 +0200 Subject: [PATCH] uprava i napovedy u pozice --- admin.go | 7 ++++++- templates/adminPositions.html | 14 ++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/admin.go b/admin.go index a299d85..57ff532 100644 --- a/admin.go +++ b/admin.go @@ -495,7 +495,12 @@ func AdminPositionsHandler(w http.ResponseWriter, r *http.Request) { http.Error(w, "GPS field cannot be empty", http.StatusBadRequest) return } - _, err := db.Exec("UPDATE positions SET gps = ? WHERE id = ?", gps, positionID) + clue := r.FormValue("clue") + if clue == "" { + http.Error(w, "Clue field cannot be empty", http.StatusBadRequest) + return + } + _, err := db.Exec("UPDATE positions SET gps = ?, clue = ? WHERE id = ?", gps, clue, positionID) if err != nil { http.Error(w, "Database error", http.StatusInternalServerError) return diff --git a/templates/adminPositions.html b/templates/adminPositions.html index ee1fc98..6b96afd 100644 --- a/templates/adminPositions.html +++ b/templates/adminPositions.html @@ -19,14 +19,16 @@ {{range .}} {{.ID}} - -
+ + + - + + + -
- - {{.Clue}} + + {{.URL}}