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