mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-13 19:58:09 +00:00
Fix move application (#3733)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
parent
e32f41767f
commit
71570ec251
@ -19,7 +19,7 @@
|
||||
import { OK, Severity, Status } from '@hcengineering/platform'
|
||||
import presentation, { Card, SpaceSelect, createQuery, getClient } from '@hcengineering/presentation'
|
||||
import type { Applicant, Vacancy } from '@hcengineering/recruit'
|
||||
import task, { State, getStates } from '@hcengineering/task'
|
||||
import { State, getStates } from '@hcengineering/task'
|
||||
import ui, {
|
||||
Button,
|
||||
ColorPopup,
|
||||
@ -62,15 +62,14 @@
|
||||
if (selectedState === undefined) {
|
||||
throw new Error(`Please select initial state:${_space}`)
|
||||
}
|
||||
const state = await client.findOne(task.class.State, { space: _space, _id: selectedState?._id })
|
||||
if (state === undefined) {
|
||||
if (selectedState === undefined) {
|
||||
throw new Error(`create application: state not found space:${_space}`)
|
||||
}
|
||||
|
||||
const op = client.apply('application.states')
|
||||
|
||||
for (const a of selected) {
|
||||
await moveToSpace(op, a, _space, { status: state._id, doneState: null })
|
||||
await moveToSpace(op, a, _space, { status: selectedState._id, doneState: null })
|
||||
}
|
||||
await op.commit()
|
||||
loading = false
|
||||
|
Loading…
Reference in New Issue
Block a user