diff --git a/apps/api/src/modules/listings/infrastructure/repositories/listing-read.queries.ts b/apps/api/src/modules/listings/infrastructure/repositories/listing-read.queries.ts index c12e512..badd6fd 100644 --- a/apps/api/src/modules/listings/infrastructure/repositories/listing-read.queries.ts +++ b/apps/api/src/modules/listings/infrastructure/repositories/listing-read.queries.ts @@ -31,7 +31,8 @@ export async function findByIdWithProperty( WHERE "id" = ${listing.property.id} LIMIT 1 `; - const geo = geoRows[0] ?? { latitude: 0, longitude: 0 }; + // location is NOT NULL in the database — geo extraction always succeeds for existing properties + const geo = geoRows[0]!; return { id: listing.id, @@ -147,7 +148,8 @@ export async function searchListings( return { data: data.map((listing) => { - const geo = geoMap.get(listing.property.id) ?? { latitude: 0, longitude: 0 }; + // location is NOT NULL — every property in the result set has geo data + const geo = geoMap.get(listing.property.id)!; return { id: listing.id, status: listing.status,