it's working!!!
This commit is contained in:
@ -27,10 +27,11 @@ router.get('/', async (req, res) => {
|
||||
});
|
||||
|
||||
// POST /api/todos - Create a new todo for the logged-in user
|
||||
router.post('/', async (req, res) => {
|
||||
router.post('/newEntry', async (req, res) => {
|
||||
const userId = req.user.id;
|
||||
const { task } = req.body;
|
||||
|
||||
console.log('Received task:', task); // Log the received task for debugging
|
||||
if (!task || task.trim() === '') {
|
||||
return res.status(400).json({ message: 'Aufgabeninhalt darf nicht leer sein.' });
|
||||
}
|
||||
|
Reference in New Issue
Block a user