22 lines
347 B
JavaScript
22 lines
347 B
JavaScript
const db = require('../../data/dbConfig');
|
|
|
|
module.exports = {
|
|
getCities,
|
|
getCitiesByCountry
|
|
// getCity,
|
|
};
|
|
|
|
function getCities() {
|
|
return db('cities')
|
|
}
|
|
|
|
function getCitiesByCountry(country_id) {
|
|
return db('cities')
|
|
.where({ country_id })
|
|
}
|
|
|
|
// function getCity(name) {
|
|
// return db('cities')
|
|
// .where({ name })
|
|
// .first()
|
|
// }
|