mirror of
https://github.com/hcengineering/platform.git
synced 2025-01-03 17:05:16 +03:00
client filtering model transactions
Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
parent
daf7ea7208
commit
899e9e9f83
@ -59,8 +59,9 @@ class ClientImpl implements Client {
|
|||||||
async tx (tx: Tx): Promise<void> {
|
async tx (tx: Tx): Promise<void> {
|
||||||
if (tx.objectSpace === core.space.Model) {
|
if (tx.objectSpace === core.space.Model) {
|
||||||
this.hierarchy.tx(tx)
|
this.hierarchy.tx(tx)
|
||||||
|
await this.model.tx(tx)
|
||||||
}
|
}
|
||||||
await Promise.all([this.conn.tx(tx), this.model.tx(tx)])
|
await this.conn.tx(tx)
|
||||||
this.notify?.(tx)
|
this.notify?.(tx)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,14 +44,14 @@
|
|||||||
const query = createQuery()
|
const query = createQuery()
|
||||||
$: query.query(chunter.class.Backlink, { objectId: object._id }, result => { backlinks = result })
|
$: query.query(chunter.class.Backlink, { objectId: object._id }, result => { backlinks = result })
|
||||||
|
|
||||||
function save() {
|
async function save() {
|
||||||
const attributes: Record<string, any> = {}
|
const attributes: Record<string, any> = {}
|
||||||
for (const key in object) {
|
for (const key in object) {
|
||||||
if ((newValue as any)[key] !== (object as any)[key]) {
|
if ((newValue as any)[key] !== (object as any)[key]) {
|
||||||
attributes[key] = (newValue as any)[key]
|
attributes[key] = (newValue as any)[key]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
client.updateDoc(recruit.class.Candidate, object.space, object._id, attributes)
|
await client.updateDoc(recruit.class.Candidate, object.space, object._id, attributes)
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user