const express = require('express')
const request = require('request')
const Mysql = require("../SQLPool");
const router = express.Router()

router.get('/deleteToolBoxById', (req, res) => {
    const {toolbox_id} = req.query
    const SQL = 'DELETE FROM toolbox WHERE toolbox_id = ?'
    try {
        Mysql.query(SQL, [toolbox_id], (err, result) => {
            if (err) {
                res.send({
                    success: false,
                    err
                })
                throw err
            }
            res.send({
                success: true,
                data: result
            })
        })
    }catch (e){
        console.error(e)
    }

})

module.exports = router
