mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-14 07:52:15 +00:00
fix(cron): process team board tasks assigned to the user
This commit is contained in:
parent
f843564444
commit
45fc2b62e3
1 changed files with 13 additions and 4 deletions
|
|
@ -74,10 +74,19 @@ async function cronAsync (req, res) {
|
|||
}
|
||||
|
||||
const tasks = await Tasks.Task.find({
|
||||
userId: user._id,
|
||||
$or: [ // Exclude completed todos
|
||||
{ type: 'todo', completed: false },
|
||||
{ type: { $in: ['habit', 'daily', 'reward'] } },
|
||||
$and: [
|
||||
{
|
||||
$or: [
|
||||
{ userId: user._id },
|
||||
{ userId: { $exists: false }, 'group.assignedUsers': user._id },
|
||||
],
|
||||
},
|
||||
{
|
||||
$or: [ // Exclude completed todos
|
||||
{ type: 'todo', completed: false },
|
||||
{ type: { $in: ['habit', 'daily', 'reward'] } },
|
||||
],
|
||||
},
|
||||
],
|
||||
}).exec();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue