modified: blueprints/sync_server.py
modified: core/sync.py
This commit is contained in:
@@ -34,6 +34,16 @@ def sync_push():
|
||||
for d in data.get('deletions', []):
|
||||
et = d['entity_type']
|
||||
eu = d['entity_uuid']
|
||||
# Log to server's sync_deletions so other pulling clients see it
|
||||
existing = conn.execute(
|
||||
"SELECT id FROM sync_deletions WHERE entity_type = ? AND entity_uuid = ?",
|
||||
(et, eu)
|
||||
).fetchone()
|
||||
if not existing:
|
||||
conn.execute(
|
||||
"INSERT INTO sync_deletions (entity_type, entity_uuid, deleted_at) VALUES (?, ?, ?)",
|
||||
(et, eu, synced_at)
|
||||
)
|
||||
if et == 'debtor':
|
||||
conn.execute("DELETE FROM debtors WHERE uuid = ?", (eu,))
|
||||
elif et == 'ticket':
|
||||
|
||||
Reference in New Issue
Block a user