fix(listings): extract PostGIS coordinates in read queries instead of returning 0,0
findByIdWithProperty and searchListings used Prisma include which cannot extract PostGIS geometry(Point,4326) columns. Added raw SQL with ST_Y/ST_X to return actual lat/lng. Search uses batch extraction via ANY() for efficiency. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -23,6 +23,8 @@ export interface ListingDetailData {
|
||||
ward: string;
|
||||
district: string;
|
||||
city: string;
|
||||
latitude: number;
|
||||
longitude: number;
|
||||
areaM2: number;
|
||||
bedrooms: number | null;
|
||||
bathrooms: number | null;
|
||||
@@ -70,6 +72,8 @@ export interface ListingSearchItem {
|
||||
address: string;
|
||||
district: string;
|
||||
city: string;
|
||||
latitude: number;
|
||||
longitude: number;
|
||||
areaM2: number;
|
||||
bedrooms: number | null;
|
||||
bathrooms: number | null;
|
||||
|
||||
Reference in New Issue
Block a user