diff --git a/plugins/view-resources/src/components/KanbanView.svelte b/plugins/view-resources/src/components/KanbanView.svelte index 11dec620ef..cbb5f5a887 100644 --- a/plugins/view-resources/src/components/KanbanView.svelte +++ b/plugins/view-resources/src/components/KanbanView.svelte @@ -39,7 +39,7 @@ import { _ID_SEPARATOR } from '@anticrm/platform'; export let config: string[] let states: State[] = [] - let objects: (Doc & { state: Ref })[] + let objects: (Doc & { state: Ref })[] = [] const statesQuery = createQuery() $: statesQuery.query(core.class.State, { space }, result => { states = result }) diff --git a/server/mongo/src/storage.ts b/server/mongo/src/storage.ts index cec689c732..5a750b7d21 100644 --- a/server/mongo/src/storage.ts +++ b/server/mongo/src/storage.ts @@ -13,7 +13,7 @@ // limitations under the License. // -import type { Tx, Ref, Doc, Class, DocumentQuery, FindResult, FindOptions, TxCreateDoc } from '@anticrm/core' +import type { Tx, Ref, Doc, Class, DocumentQuery, FindResult, FindOptions, TxCreateDoc, TxUpdateDoc } from '@anticrm/core' import core, { TxProcessor, Hierarchy, DOMAIN_TX, SortingOrder } from '@anticrm/core' import type { DbAdapter, TxAdapter } from '@anticrm/server-core' @@ -95,9 +95,14 @@ class MongoAdapter extends MongoAdapterBase { protected override async txCreateDoc (tx: TxCreateDoc): Promise { const doc = TxProcessor.createDoc2Doc(tx) const domain = this.hierarchy.getDomain(doc._class) - console.log('mongo', domain, doc) await this.db.collection(domain).insertOne(translateDoc(doc)) } + + protected override async txUpdateDoc (tx: TxUpdateDoc): Promise { + const domain = this.hierarchy.getDomain(tx.objectClass) + const result = await this.db.collection(domain).updateOne({ _id: tx.objectId }, { $set: tx.operations }) + console.log('update result', result) + } } class MongoTxAdapter extends MongoAdapterBase implements TxAdapter {