Skip to content

Commit

Permalink
Add getAllCountries model
Browse files Browse the repository at this point in the history
Relates #8
Co-authored-by: ephieo <[email protected]>
  • Loading branch information
JoshDAO committed Oct 19, 2020
1 parent ac1b9ce commit 6929c90
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Empty file added src/handlers/countries.js
Empty file.
10 changes: 10 additions & 0 deletions src/model/countries.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const db = require("../database/connection");

function getAllCountries() {
return db
.query("SELECT * FROM countries")
.then(result => result.rows)
.catch(error);
}

module.exports = { getAllCountries };

0 comments on commit 6929c90

Please sign in to comment.