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:
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user