add google maps link to location detail response

This commit is contained in:
nochill 2023-09-21 15:54:49 +07:00
parent f6442fca2e
commit bee8f6e5b8
2 changed files with 4 additions and 0 deletions

View File

@ -24,6 +24,7 @@ SELECT
l.id, l.id,
l.name, l.name,
l.address, l.address,
COALESCE(l.google_maps_link, '') as google_maps_link,
l.thumbnail, l.thumbnail,
l.submitted_by, l.submitted_by,
COALESCE(r.regency_name, '') as regency_name, COALESCE(r.regency_name, '') as regency_name,

View File

@ -151,6 +151,7 @@ SELECT
l.id, l.id,
l.name, l.name,
l.address, l.address,
COALESCE(l.google_maps_link, '') as google_maps_link,
l.thumbnail, l.thumbnail,
l.submitted_by, l.submitted_by,
COALESCE(r.regency_name, '') as regency_name, COALESCE(r.regency_name, '') as regency_name,
@ -169,6 +170,7 @@ type GetLocationRow struct {
ID int32 `json:"id"` ID int32 `json:"id"`
Name string `json:"name"` Name string `json:"name"`
Address string `json:"address"` Address string `json:"address"`
GoogleMapsLink string `json:"google_maps_link"`
Thumbnail sql.NullString `json:"thumbnail"` Thumbnail sql.NullString `json:"thumbnail"`
SubmittedBy int32 `json:"submitted_by"` SubmittedBy int32 `json:"submitted_by"`
RegencyName string `json:"regency_name"` RegencyName string `json:"regency_name"`
@ -184,6 +186,7 @@ func (q *Queries) GetLocation(ctx context.Context, id int32) (GetLocationRow, er
&i.ID, &i.ID,
&i.Name, &i.Name,
&i.Address, &i.Address,
&i.GoogleMapsLink,
&i.Thumbnail, &i.Thumbnail,
&i.SubmittedBy, &i.SubmittedBy,
&i.RegencyName, &i.RegencyName,