diff --git a/src/db/lib.ts b/src/db/lib.ts index 0a2ff51..db0f0a4 100644 --- a/src/db/lib.ts +++ b/src/db/lib.ts @@ -1,6 +1,7 @@ import { cloneDeep } from 'lodash'; import { state } from '../db-admin/health-legacy'; import { getParentId } from '../lib/docuri'; +import { dbUrlToUserId } from '../lib/user-id'; declare global { var localDb: any; @@ -35,7 +36,7 @@ export const put = async ( _rev: current._rev, type, to: current.to, - origin: current.origin ?? state().remoteUrl, + origin: current.origin ?? dbUrlToUserId(state().remoteUrl), doc: update(current.doc), }; await targetDb.put(putDoc);