mirror of
https://github.com/hcengineering/platform.git
synced 2025-01-08 21:27:45 +03:00
Fix incorrect space for taskType (#4322)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
parent
85c98ead17
commit
5d889380ab
@ -24,8 +24,9 @@ import {
|
||||
} from '@hcengineering/model'
|
||||
import core, { DOMAIN_SPACE } from '@hcengineering/model-core'
|
||||
import tags from '@hcengineering/model-tags'
|
||||
import { taskId } from '@hcengineering/task'
|
||||
import { type TaskType, taskId } from '@hcengineering/task'
|
||||
import task from './plugin'
|
||||
import { DOMAIN_TASK } from '.'
|
||||
|
||||
/**
|
||||
* @public
|
||||
@ -129,6 +130,18 @@ export const taskOperation: MigrateOperation = {
|
||||
}
|
||||
)
|
||||
}
|
||||
},
|
||||
{
|
||||
state: 'fixIncorrectTaskTypeSpace',
|
||||
func: async (client) => {
|
||||
const taskTypes = await client.find<TaskType>(DOMAIN_TASK, {
|
||||
_class: task.class.TaskType,
|
||||
space: core.space.Model
|
||||
})
|
||||
for (const taskType of taskTypes) {
|
||||
await client.update(DOMAIN_TASK, { _id: taskType._id }, { $set: { space: taskType.parent } })
|
||||
}
|
||||
}
|
||||
}
|
||||
])
|
||||
},
|
||||
|
@ -360,7 +360,7 @@ async function createTaskTypes (
|
||||
projectType: _id
|
||||
})
|
||||
}
|
||||
await client.createDoc(task.class.TaskType, core.space.Model, tdata as Data<TaskType>, taskId)
|
||||
await client.createDoc(task.class.TaskType, _id, tdata as Data<TaskType>, taskId)
|
||||
tasksData.set(taskId, tdata as Data<TaskType>)
|
||||
_tasks.push(taskId)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user