diff --git a/apps/blakus-api/src/app/routes/blakus.ts b/apps/blakus-api/src/app/routes/blakus.ts index 126e6ad..1d22ea6 100644 --- a/apps/blakus-api/src/app/routes/blakus.ts +++ b/apps/blakus-api/src/app/routes/blakus.ts @@ -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,