// Загрузка списка пиццы
const pool = require("../../../server/db/connect");

const queryString = "SELECT * FROM products WHERE status=1 and id=?";

export default function handler(req, res)  {
    //const data = req.body;
    const { pid } = req.query
    pool.getConnection(function(err, conn) {
        // Do something with the connection
        conn.query(queryString, [pid], function(err, rows, fields) {
            res.status(200).json(rows);
            console.log(rows);
         });
        // Don't forget to release the connection when finished!
        pool.releaseConnection(conn);
     })
}