i am attempting to stor and ueryy locations baased on coordinate points with Monodb in my sql.query sestem is not working a i have some api in my controlllers.jss, there are mySQL database apis now Im tryng a
const handleQuantitySubmit = e => {
e.preventDefault();
try {
const url = `http://localhost:5000/addQuantity/${inventoryId}?oldQuantity=${item.quantity}`;
const updateQuantity = async () => {
const response = await axios.put(url, { quantity })
console.log(response.data.massage);
}
updateQuantity();
} catch {
}
}`enter code here`
// put update user server site
app.put('/item/:id', async (req, res) => {
const id = req.params.id;
const updatedUser = req.body;
const filter = { _id: ObjectId(id) };
const options = { upsert: true };
const updatedDoc = {
$set: {
quantity: updatedUser.newQuantity
}
};
const result = await itemCollection.updateOne(filter, updatedDoc, options)
res.send(result)
})