Add serial_number to barcode search
- /api/assets/search now also matches serial_number column so scanning a sticker with just the serial number works
This commit is contained in:
@@ -1129,8 +1129,8 @@ def list_assets(
|
||||
def search_by_machine_id(machine_id: str = Query(...)):
|
||||
conn = get_db()
|
||||
row = conn.execute(
|
||||
"SELECT * FROM assets WHERE machine_id = ? OR connect_id = ?",
|
||||
(machine_id, machine_id),
|
||||
"SELECT * FROM assets WHERE machine_id = ? OR connect_id = ? OR serial_number = ?",
|
||||
(machine_id, machine_id, machine_id),
|
||||
).fetchone()
|
||||
conn.close()
|
||||
if row is None:
|
||||
|
||||
Reference in New Issue
Block a user