mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-11 17:27:31 +02:00
Fix task due date not saving correctly to a future date
Add console logging to client and server to debug and fix an issue where task due dates were not being saved correctly, defaulting to the current date instead of the selected future date. 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/xi95nEa
This commit is contained in:
1 parent
c8b76c8b2e
commit
87cc2a0f88
4 files changed
+93
-2
No files matched your search
@@ -1622,16 +1622,47 @@ export class DatabaseStorage implements IStorage {
|
||||
}
|
||||
|
||||
async createTask(taskData: InsertTask): Promise<Task> {
|
||||
console.log('💾 DatabaseStorage.createTask - Input:', {
|
||||
taskData,
|
||||
dueDate: taskData.dueDate,
|
||||
dueDateType: typeof taskData.dueDate,
|
||||
dueDateISO: taskData.dueDate instanceof Date ? taskData.dueDate.toISOString() : taskData.dueDate
|
||||
});
|
||||
|
||||
const [task] = await db.insert(tasks).values(taskData).returning();
|
||||
|
||||
console.log('💾 DatabaseStorage.createTask - Result:', {
|
||||
taskId: task.id,
|
||||
title: task.title,
|
||||
dueDate: task.dueDate,
|
||||
dueDateType: typeof task.dueDate
|
||||
});
|
||||
|
||||
return task;
|
||||
}
|
||||
|
||||
async updateTask(id: number, taskData: Partial<InsertTask>): Promise<Task> {
|
||||
console.log('💾 DatabaseStorage.updateTask - Input:', {
|
||||
taskId: id,
|
||||
taskData,
|
||||
dueDate: taskData.dueDate,
|
||||
dueDateType: typeof taskData.dueDate,
|
||||
dueDateISO: taskData.dueDate instanceof Date ? taskData.dueDate.toISOString() : taskData.dueDate
|
||||
});
|
||||
|
||||
const [task] = await db
|
||||
.update(tasks)
|
||||
.set({ ...taskData, updatedAt: new Date() })
|
||||
.where(eq(tasks.id, id))
|
||||
.returning();
|
||||
|
||||
console.log('💾 DatabaseStorage.updateTask - Result:', {
|
||||
taskId: task.id,
|
||||
title: task.title,
|
||||
dueDate: task.dueDate,
|
||||
dueDateType: typeof task.dueDate
|
||||
});
|
||||
|
||||
return task;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user