From f6ce5f91a21f4364c464dafeaf1199a77e89121d Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Mon, 9 Mar 2026 22:18:24 +0000 Subject: [PATCH] Match up distance from reporter in UI and API --- html/template/sync/communication-root.html | 2 +- platform/publicreport/image.go | 2 +- platform/types/image.go | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/html/template/sync/communication-root.html b/html/template/sync/communication-root.html index 8db7a339..3039ee53 100644 --- a/html/template/sync/communication-root.html +++ b/html/template/sync/communication-root.html @@ -883,7 +883,7 @@ >Distance from Reporter diff --git a/platform/publicreport/image.go b/platform/publicreport/image.go index 4188c004..b9f10a29 100644 --- a/platform/publicreport/image.go +++ b/platform/publicreport/image.go @@ -35,7 +35,7 @@ func loadImagesForReportNuisance(ctx context.Context, org_id int32, report_ids [ "i.storage_uuid AS uuid", "COALESCE(ST_X(i.location), 0) AS \"location.longitude\"", "COALESCE(ST_Y(i.location), 0) AS \"location.latitude\"", - "ST_Distance(i.location::geography, n.location::geography) AS \"distance_to_reporter_meters\"", + "ST_Distance(i.location::geography, n.location::geography) AS \"distance_from_reporter_meters\"", "COALESCE(MAX(e.value) FILTER (WHERE e.name = 'Make'), '') AS exif_make", "COALESCE(MAX(e.value) FILTER (WHERE e.name = 'Model'), '') AS exif_model", "COALESCE(MAX(e.value) FILTER (WHERE e.name = 'DateTime'), '') AS exif_datetime", diff --git a/platform/types/image.go b/platform/types/image.go index e3faf369..30987ce1 100644 --- a/platform/types/image.go +++ b/platform/types/image.go @@ -35,7 +35,7 @@ func (e Exif) MarshalJSON() ([]byte, error) { } type Image struct { - DistanceToReporterMeters float64 `db:"distance_to_reporter_meters"` + DistanceToReporterMeters float64 `db:"distance_from_reporter_meters"` Exif Exif `db:"-" json:"exif"` ExifMake string `db:"exif_make" json:"-"` ExifModel string `db:"exif_model" json:"-"` @@ -48,7 +48,7 @@ type Image struct { func (i *Image) MarshalJSON() ([]byte, error) { to_marshal := make(map[string]interface{}, 0) - to_marshal["distance_to_reporter_meters"] = i.DistanceToReporterMeters + to_marshal["distance_from_reporter_meters"] = i.DistanceToReporterMeters to_marshal["exif"] = Exif{ Created: i.ExifDateTime, Make: i.ExifMake,