mirror of
https://gitlab.com/nekoya/web.git
synced 2024-11-14 02:16:19 +01:00
Update api with current structure
This commit is contained in:
parent
5003dcd8b2
commit
a0e0e6a667
1 changed files with 2 additions and 2 deletions
|
@ -4,14 +4,14 @@ const db = require('../modules/db')
|
|||
|
||||
router.get('/getproducts', (req, res) => {
|
||||
const conn = db.connect();
|
||||
conn.execute('SELECT * FROM `product`', [], function(err, results) {
|
||||
conn.execute('SELECT * FROM `products`', [], function(err, results) {
|
||||
res.json(results);
|
||||
});
|
||||
})
|
||||
|
||||
router.get('/getproduct', (req, res) => {
|
||||
const conn = db.connect();
|
||||
conn.execute('SELECT * FROM `product` WHERE `model` = ?', [req.query.id], function(err, results) {
|
||||
conn.execute('SELECT * FROM `products` WHERE `ID` = ?', [req.query.id], function(err, results) {
|
||||
res.json(results);
|
||||
});
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue