fix: Timesheet naming and todo auto-assign fixes

- Fix timesheet filename to use firstName-lastName format with username fallback
- Remove auto-assign creator to todos (user must manually select assignees)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
richardtekula
2026-01-22 11:20:10 +01:00
parent e5a88c36a9
commit 5ade261cb2
2 changed files with 14 additions and 16 deletions

View File

@@ -209,16 +209,6 @@ export const createTodo = async (userId, data) => {
await db.insert(todoUsers).values(todoUserInserts);
}
// Auto-assign the creator to the todo so they can access it (if not already assigned)
const creatorAlreadyAssigned = assignedUserIds && assignedUserIds.includes(userId);
if (!creatorAlreadyAssigned) {
await db.insert(todoUsers).values({
todoId: newTodo.id,
userId: userId,
assignedBy: userId,
});
}
// Send push notifications to assigned users (excluding creator)
if (assignedUserIds && Array.isArray(assignedUserIds) && assignedUserIds.length > 0) {
try {