diff --git a/models/tracker/src/index.ts b/models/tracker/src/index.ts index f42120e500..8f233e4419 100644 --- a/models/tracker/src/index.ts +++ b/models/tracker/src/index.ts @@ -916,7 +916,7 @@ export function createModel (builder: Builder): void { component: tracker.component.SetParentIssueActionPopup, element: 'top', fillProps: { - _object: 'value' + _objects: 'value' } }, label: tracker.string.SetParent, diff --git a/packages/query/src/index.ts b/packages/query/src/index.ts index e78acc8612..4f50fb6d47 100644 --- a/packages/query/src/index.ts +++ b/packages/query/src/index.ts @@ -547,7 +547,14 @@ export class LiveQuery extends TxProcessor implements Client { if (q.result instanceof Promise) { q.result = await q.result } - q.result.push(res[0]) + const doc = res[0] + const pos = q.result.findIndex((el) => el._id === doc._id) + if (pos !== -1) { + q.result[pos] = doc + } else { + q.result.push(doc) + q.total++ + } return true } } diff --git a/plugins/view-resources/src/actionImpl.ts b/plugins/view-resources/src/actionImpl.ts index 85ef092c82..15e6efda16 100644 --- a/plugins/view-resources/src/actionImpl.ts +++ b/plugins/view-resources/src/actionImpl.ts @@ -221,6 +221,8 @@ async function ShowPopup ( } if (docKey === '_object') { ;(cprops as any)[propKey] = docs[0] + } else if (docKey === '_objects') { + ;(cprops as any)[propKey] = docs.length === 1 ? docs[0] : docs } }