duties widget correction
This commit is contained in:
parent
aa0c41f1ea
commit
966dc18faf
@ -152,8 +152,9 @@ export async function GET(request: NextRequest) {
|
||||
|
||||
const tasks = data.result
|
||||
.filter((task: any) => {
|
||||
// Skip completed tasks (status 5)
|
||||
// Skip all completed tasks (status 5), whether they are main tasks or subtasks
|
||||
if (task.status === 5) {
|
||||
console.log(`Filtering out completed task ${task.id} (type: ${task.type || 'main'})`);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -162,7 +163,9 @@ export async function GET(request: NextRequest) {
|
||||
const currentUserId = String(userId).trim();
|
||||
|
||||
// Only show tasks where the user is the editor
|
||||
return taskEditorId === currentUserId;
|
||||
const isUserEditor = taskEditorId === currentUserId;
|
||||
console.log(`Task ${task.id}: status=${task.status}, type=${task.type || 'main'}, isUserEditor=${isUserEditor}`);
|
||||
return isUserEditor;
|
||||
})
|
||||
.map((task: any) => ({
|
||||
id: task.id.toString(),
|
||||
@ -177,7 +180,8 @@ export async function GET(request: NextRequest) {
|
||||
editedOn: task.editedOn || null,
|
||||
editorId: task.editorId,
|
||||
editorFirstname: task.editorFirstname,
|
||||
editorLastname: task.editorLastname
|
||||
editorLastname: task.editorLastname,
|
||||
type: task.type || null // Added type field to identify subtasks
|
||||
}));
|
||||
|
||||
console.log(`Found ${tasks.length} tasks assigned to user ${userId}`);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user