15 lines
447 B
JavaScript
15 lines
447 B
JavaScript
module.exports = async (dbConn, lat, long, radius) => {
|
|
const regions = await dbConn.query(
|
|
`SELECT regions.id AS region_id,
|
|
regions.region AS name,
|
|
regions.country_id AS country_id,
|
|
countries.country AS country,
|
|
regions.meteostat_id AS meteostat_id
|
|
FROM regions
|
|
JOIN countries
|
|
ON regions.country_id = countries.id`
|
|
);
|
|
return regions;
|
|
};
|
|
|