mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-18 16:31:57 +03:00
UBERF-8851: Fix isDone is wrong (#7456)
This commit is contained in:
parent
5832ac119a
commit
5175381f06
@ -572,6 +572,37 @@ export const taskOperation: MigrateOperation = {
|
||||
{
|
||||
state: 'migrateRanks',
|
||||
func: migrateRanks
|
||||
},
|
||||
{
|
||||
state: 'migrate_wrong_isdone',
|
||||
func: async (client: MigrationClient) => {
|
||||
const statuses = client.model.findAllSync(core.class.Status, {
|
||||
category: { $in: [task.statusCategory.Won, task.statusCategory.Lost] }
|
||||
})
|
||||
|
||||
await client.update<Task>(
|
||||
DOMAIN_TASK,
|
||||
{
|
||||
_class: { $in: client.hierarchy.getDescendants(task.class.Task) },
|
||||
status: { $in: statuses.map((it) => it._id) },
|
||||
isDone: false
|
||||
},
|
||||
{
|
||||
isDone: true
|
||||
}
|
||||
)
|
||||
await client.update<Task>(
|
||||
DOMAIN_TASK,
|
||||
{
|
||||
_class: { $in: client.hierarchy.getDescendants(task.class.Task) },
|
||||
status: { $nin: statuses.map((it) => it._id) },
|
||||
isDone: true
|
||||
},
|
||||
{
|
||||
isDone: false
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
])
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user