Fixed saved Premium 93 station logic and display.

This commit is contained in:
Eric Gullickson
2025-12-21 13:56:59 -06:00
parent 95f5e89e48
commit 144f1d5bb0
7 changed files with 335 additions and 377 deletions

View File

@@ -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
`;