@davoodmehraban89 / Factor-easy-2 Mirror · read-only / commits / 2a2a992
Fork 0

سامانه صدور فاکتور و حسابداری

Mirrored from https://github.com/davoodmehraban89/Factor-easy.git

Synced Dec 4, 01:45 UTC

fix: scope generic sync writes to the active organization

davoodmehraban89 committed Nov 17, 2026 at 14:00 UTC 2a2a992316f8d697f454e38924ed16e74350f30a
1 file changed +2 -1
js/sync.js
+2 -1
@@ -87,7 +87,8 @@ async function runSync(){
87 const deletes=del.map(k=>{const j=k.indexOf('|');return {collection:k.slice(0,j),id:k.slice(j+1)};});
88 const {error}=await sb.rpc('finora_sync_records',{
89 p_upserts:up.map(r=>({collection:r.coll,id:r.id,data:r.payload})),
90 - p_deletes:deletes
90 + p_deletes:deletes,
91 + p_organization_id:currentUser.organizationId||null
92 });
93 if(error)throw error;
94 up.forEach(r=>syncSnap.set(r.key,r.s));