Currently, users can only delete history items one by one. This is time-consuming for users with lots of history.
Goals
- Allow users to delete multiple history items at once
- Select items via checkboxes
- Confirm before bulk delete
Implementation
// Backend
app.delete('/api/history/bulk', protect, async (req, res) => {
const { ids } = req.body;
await History.deleteMany({
_id: { $in: ids },
user: req.user.id
});
res.json({ success: true, deletedCount: ids.length });
});
// Frontend
// Add checkboxes to history items
// Select all / Deselect all buttons
// Bulk delete button
Currently, users can only delete history items one by one. This is time-consuming for users with lots of history.
Goals
Implementation
// Backend
// Frontend
// Add checkboxes to history items
// Select all / Deselect all buttons
// Bulk delete button