fix: admin upload action fillForm()->refreshFormData(['photo_url']) (fillForm threw in action closure); photo cache-busting (?v=updated_at) so overwritten photos don't show stale browser cache (user 'reverting to old images')

This commit is contained in:
2026-08-10 16:18:08 +10:00
parent 0a66d92d31
commit fd91d3c53e
6 changed files with 10 additions and 4 deletions

View File

@@ -3,11 +3,14 @@ package handlers
import (
"net/http"
"github.com/jackc/pgx/v5/pgtype"
"wherewoof/frontend/internal/db"
)
// locationData is passed to the owner's location page template.
type locationData struct {
UpdatedAt pgtype.Timestamptz
Lat float64
Lng float64
FinderPhone string
@@ -44,6 +47,7 @@ func (a *App) ServeShort(w http.ResponseWriter, r *http.Request) {
}
data := locationData{
UpdatedAt: tag.UpdatedAt,
Lat: scan.Lat.Float64,
Lng: scan.Lng.Float64,
FinderPhone: scan.ScannerPhone.String,

View File

@@ -11,6 +11,7 @@ import (
)
type publicData struct {
UpdatedAt pgtype.Timestamptz
ID int64
TagCode string
Status string
@@ -47,6 +48,7 @@ func (a *App) PublicTag(w http.ResponseWriter, r *http.Request) {
}
pd := publicData{
UpdatedAt: tag.UpdatedAt,
ID: tag.ID,
TagCode: tag.TagCode,
Status: tag.Status,