mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-28 04:25:03 +02:00
Update doneStates of existing kanban cards (#625)
Signed-off-by: Ilya Sumbatyants <ilya.sumb@gmail.com>
This commit is contained in:
@@ -129,9 +129,22 @@
|
||||
}
|
||||
|
||||
const onDone = (state: DoneState) => async () => {
|
||||
await client.updateDoc(dragCard._class, dragCard.space, dragCard._id, {
|
||||
doneState: state._id
|
||||
})
|
||||
if (client.getHierarchy().isDerived(_class, core.class.AttachedDoc)) {
|
||||
const adoc: AttachedDoc = dragCard as Doc as AttachedDoc
|
||||
await client.updateCollection(
|
||||
_class,
|
||||
space,
|
||||
adoc._id as Ref<Doc> as Ref<AttachedDoc>,
|
||||
adoc.attachedTo,
|
||||
adoc.attachedToClass,
|
||||
adoc.collection,
|
||||
{ doneState: state._id }
|
||||
)
|
||||
} else {
|
||||
await client.updateDoc(dragCard._class, dragCard.space, dragCard._id, {
|
||||
doneState: state._id
|
||||
})
|
||||
}
|
||||
|
||||
isDragging = false
|
||||
hoveredDoneState = undefined
|
||||
|
||||
Reference in New Issue
Block a user