Skip to content

Commit

Permalink
Create getShopCoordinates dbQueries function to get location object f…
Browse files Browse the repository at this point in the history
…rom database for a shop - ref #51
  • Loading branch information
macintoshhelper committed May 3, 2017
1 parent 739d1de commit 0c739bd
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/dbQueries.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const dbConnection = require('../database/db_connection');

const dbQueries = {};

dbQueries.getShopCoordinates = (shopId, callback) => {
dbConnection.query('SELECT location FROM shops WHERE id = $1', [shopId], callback);
};

// dbQueries.getShopCoordinates(1, (err, res) => {
// if (err) console.log(err);
// console.log(res.rows[0]);
// });


module.exports = dbQueries;

0 comments on commit 0c739bd

Please sign in to comment.