Fixed saved Premium 93 station logic and display.
This commit is contained in:
@@ -414,11 +414,11 @@ export class CommunityStationsRepository {
|
||||
): Promise<CommunityStation | null> {
|
||||
const query = `
|
||||
SELECT * FROM community_stations
|
||||
WHERE latitude BETWEEN $1 - $3 AND $1 + $3
|
||||
AND longitude BETWEEN $2 - $3 AND $2 + $3
|
||||
WHERE latitude BETWEEN ($1::NUMERIC - $3::NUMERIC) AND ($1::NUMERIC + $3::NUMERIC)
|
||||
AND longitude BETWEEN ($2::NUMERIC - $3::NUMERIC) AND ($2::NUMERIC + $3::NUMERIC)
|
||||
AND status = 'approved'
|
||||
ORDER BY
|
||||
(latitude - $1) * (latitude - $1) + (longitude - $2) * (longitude - $2) ASC
|
||||
(latitude - $1::NUMERIC) * (latitude - $1::NUMERIC) + (longitude - $2::NUMERIC) * (longitude - $2::NUMERIC) ASC
|
||||
LIMIT 1
|
||||
`;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user