From bee8f6e5b8d43bf76f9c247f4edd8350e9da3515 Mon Sep 17 00:00:00 2001 From: nochill Date: Thu, 21 Sep 2023 15:54:49 +0700 Subject: [PATCH] add google maps link to location detail response --- db/queries/locations.sql | 1 + db/sqlc/locations.sql.go | 3 +++ 2 files changed, 4 insertions(+) diff --git a/db/queries/locations.sql b/db/queries/locations.sql index 1a15813..0bf700e 100644 --- a/db/queries/locations.sql +++ b/db/queries/locations.sql @@ -24,6 +24,7 @@ SELECT l.id, l.name, l.address, + COALESCE(l.google_maps_link, '') as google_maps_link, l.thumbnail, l.submitted_by, COALESCE(r.regency_name, '') as regency_name, diff --git a/db/sqlc/locations.sql.go b/db/sqlc/locations.sql.go index c974938..6b5d4e5 100644 --- a/db/sqlc/locations.sql.go +++ b/db/sqlc/locations.sql.go @@ -151,6 +151,7 @@ SELECT l.id, l.name, l.address, + COALESCE(l.google_maps_link, '') as google_maps_link, l.thumbnail, l.submitted_by, COALESCE(r.regency_name, '') as regency_name, @@ -169,6 +170,7 @@ type GetLocationRow struct { ID int32 `json:"id"` Name string `json:"name"` Address string `json:"address"` + GoogleMapsLink string `json:"google_maps_link"` Thumbnail sql.NullString `json:"thumbnail"` SubmittedBy int32 `json:"submitted_by"` RegencyName string `json:"regency_name"` @@ -184,6 +186,7 @@ func (q *Queries) GetLocation(ctx context.Context, id int32) (GetLocationRow, er &i.ID, &i.Name, &i.Address, + &i.GoogleMapsLink, &i.Thumbnail, &i.SubmittedBy, &i.RegencyName,