Client Repo Link - bistro-boss-client-with-Cart
BistroBoss is a comprehensive restaurant management system designed to streamline operations, enhance customer experience, and improve overall efficiency. The system leverages modern web technologies to provide a robust, scalable, and high-performance solution for managing complex data structures and interactions within a restaurant environment.
- GET /cart: Retrieve all cart items.
app.get('/carts', async (req, res) => {
const email = req.query.email;
const query = { email: email };
const result = await cartCollection.find(query).toArray();
res.send(result);
});
- POST /cart: insert into all cart collection.
app.post('/carts', async (req, res) => {
const cartItem = req.body;
const result = await cartCollection.insertOne(cartItem);
res.send(result);
});
- DELETE /cart: Delete a specific cart item from cart collection.
app.delete('/carts/:id', async (req, res) => {
const id = req.params.id;
const query = { _id: new ObjectId(id) }
const result = await cartCollection.deleteOne(query);
res.send(result);
})
- GET /menu: Retrieve all menu items.
app.get('/menu', async (req, res) => { const result = await menuCollection.find().toArray(); res.send(result); });