16 lines
240 B
JavaScript
16 lines
240 B
JavaScript
|
const db = require('../data/dbConfig');
|
||
|
|
||
|
module.exports = {
|
||
|
getCountries,
|
||
|
getCountryByName,
|
||
|
};
|
||
|
|
||
|
function getCountries() {
|
||
|
return db('countries')
|
||
|
}
|
||
|
|
||
|
function getCountryByName(name) {
|
||
|
return db('countries')
|
||
|
.where({ name })
|
||
|
.first()
|
||
|
}
|