modified: blueprints/inventory.py
modified: blueprints/sync_server.py modified: core/sync.py
This commit is contained in:
@@ -88,6 +88,7 @@ def delete(barcode):
|
||||
cache_dir = current_app.config['CACHE_DIR']
|
||||
|
||||
with get_db_connection() as conn:
|
||||
conn.execute('INSERT INTO sync_deletions (entity_type, entity_uuid) VALUES (?, ?)', ('product', barcode))
|
||||
conn.execute('DELETE FROM products WHERE barcode = ?', (barcode,))
|
||||
conn.commit()
|
||||
|
||||
@@ -133,6 +134,8 @@ def bulk_delete():
|
||||
|
||||
try:
|
||||
with get_db_connection() as conn:
|
||||
for barcode in barcodes:
|
||||
conn.execute('INSERT INTO sync_deletions (entity_type, entity_uuid) VALUES (?, ?)', ('product', barcode))
|
||||
conn.execute(f'DELETE FROM products WHERE barcode IN ({",".join(["?"]*len(barcodes))})', barcodes)
|
||||
conn.commit()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user