diff --git a/packages/unigraph-dev-common/src/api/unigraph.ts b/packages/unigraph-dev-common/src/api/unigraph.ts index db18aa34..e2ce3000 100644 --- a/packages/unigraph-dev-common/src/api/unigraph.ts +++ b/packages/unigraph-dev-common/src/api/unigraph.ts @@ -379,9 +379,9 @@ export default function unigraph(url: string, browserId: string): Unigraph + updateObject: (uid, newObject, upsert = true, pad = true, subIds, origin, eagarlyUpdate, thisEventId: any) => new Promise((resolve, reject) => { - const id = getRandomInt(); + const id = thisEventId || getRandomInt(); callbacks[id] = (response: any) => { if (response.success) resolve(id); else reject(response); @@ -400,11 +400,17 @@ export default function unigraph(url: string, browserId: string): Unigraph { // Merge updater object with existing one // console.log('subId0', JSON.parse(JSON.stringify(subResults[subId]))); + const id = eventId; let newObj: any; if (fullObject) { newObj = updater; @@ -419,9 +425,9 @@ export default function unigraph(url: string, browserId: string): Unigraph { diff --git a/packages/unigraph-dev-common/src/types/unigraph.ts b/packages/unigraph-dev-common/src/types/unigraph.ts index c83c3031..8cb913ec 100644 --- a/packages/unigraph-dev-common/src/types/unigraph.ts +++ b/packages/unigraph-dev-common/src/types/unigraph.ts @@ -266,6 +266,7 @@ export interface Unigraph { subIds?: any[] | any, origin?: any[], eagarlyUpdate?: boolean, + thisEventId?: any, ): any; /** * Deletes relationships by supplying the origin UID and JSONs to delete.