mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-28 04:25:03 +02:00
UBER-408 Issue as task (#3497)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
@@ -50,13 +50,13 @@
|
||||
async function move (doc: Doc): Promise<void> {
|
||||
const needStates = currentSpace ? hierarchy.isDerived(currentSpace._class, task.class.SpaceWithStates) : false
|
||||
if (needStates) {
|
||||
const state = await client.findOne(task.class.State, { space: doc.space })
|
||||
if (state === undefined) {
|
||||
throw new Error('Move: state not found')
|
||||
const status = await client.findOne(task.class.State, { space: doc.space })
|
||||
if (status === undefined) {
|
||||
throw new Error('Move: status not found')
|
||||
}
|
||||
const lastOne = await client.findOne((doc as Task)._class, {}, { sort: { rank: SortingOrder.Descending } })
|
||||
await moveToSpace(client, doc, space, {
|
||||
state: state._id,
|
||||
status: status._id,
|
||||
rank: calcRank(lastOne, undefined)
|
||||
})
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user