Improve task update logging and handle date formatting errors

Refine error logging in task update routes and storage, and adjust date handling to correctly process null or empty date strings, preventing runtime errors.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: cc2d271b-82f0-4d6a-9302-a0b067ffb429
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/cc2d271b-82f0-4d6a-9302-a0b067ffb429/mibRh7v
This commit is contained in:
michaelschal committed 2025-08-19 11:23:54 +00:00
1 parent c3f08bb788
commit 24b7d67745
4 files changed
+218 -6

No files matched your search

+13 -3
View File
@@ -1482,11 +1482,21 @@ export async function registerRoutes(app: Express): Promise<Server> {
});
res.json(updatedTask);
} catch (error) {
console.error("❌ Error updating task:", {
taskId: id,
const taskId = parseInt(req.params.id);
console.error("❌ Error updating task in route:", {
taskId: taskId,
error: error instanceof Error ? error.message : String(error),
stack: error instanceof Error ? error.stack : undefined,
reqBody: req.body
reqBody: req.body,
cleanData: req.body ? {
title: req.body.title,
description: req.body.description,
priority: req.body.priority,
status: req.body.status,
assignedTo: req.body.assignedTo,
startDate: req.body.startDate,
dueDate: req.body.dueDate,
} : null
});
res.status(500).json({
message: "Failed to update task",