This commit is contained in:
parent
6e76293a94
commit
d721f2876e
@ -19,6 +19,18 @@ export default async function (fastify: FastifyInstance) {
|
|||||||
id: { type: 'string' },
|
id: { type: 'string' },
|
||||||
title: { type: 'string' },
|
title: { type: 'string' },
|
||||||
amenity: { type: 'string' },
|
amenity: { type: 'string' },
|
||||||
|
address: {
|
||||||
|
type: 'object',
|
||||||
|
properties: {
|
||||||
|
country: { type: 'string' },
|
||||||
|
county: { type: 'string' },
|
||||||
|
district: { type: 'string' },
|
||||||
|
city: { type: 'string' },
|
||||||
|
street: { type: 'string' },
|
||||||
|
house: { type: 'string' },
|
||||||
|
postalCode: { type: 'string' },
|
||||||
|
}
|
||||||
|
},
|
||||||
coords: {
|
coords: {
|
||||||
type: 'object',
|
type: 'object',
|
||||||
properties: {
|
properties: {
|
||||||
@ -43,6 +55,13 @@ export default async function (fastify: FastifyInstance) {
|
|||||||
'id',
|
'id',
|
||||||
'name',
|
'name',
|
||||||
'externalId',
|
'externalId',
|
||||||
|
'country',
|
||||||
|
'county',
|
||||||
|
'district',
|
||||||
|
'city',
|
||||||
|
'street',
|
||||||
|
'house',
|
||||||
|
'postalCode',
|
||||||
db.raw('ST_Y(coordinates::geometry) AS lat'),
|
db.raw('ST_Y(coordinates::geometry) AS lat'),
|
||||||
db.raw('ST_X(coordinates::geometry) AS lon')
|
db.raw('ST_X(coordinates::geometry) AS lon')
|
||||||
).whereRaw(
|
).whereRaw(
|
||||||
@ -79,6 +98,15 @@ export default async function (fastify: FastifyInstance) {
|
|||||||
id: place.id,
|
id: place.id,
|
||||||
title: place.name,
|
title: place.name,
|
||||||
amenity: 'pub',
|
amenity: 'pub',
|
||||||
|
address: {
|
||||||
|
country: place.country,
|
||||||
|
county: place.county,
|
||||||
|
district: place.district,
|
||||||
|
city: place.city,
|
||||||
|
street: place.street,
|
||||||
|
house: place.house,
|
||||||
|
postalCode: place.postalCode,
|
||||||
|
},
|
||||||
coords: {
|
coords: {
|
||||||
lat: place.lat,
|
lat: place.lat,
|
||||||
lon: place.lon,
|
lon: place.lon,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user