mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
Update server/db/db_helper.py
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
@@ -203,8 +203,8 @@ def get_table_json(sql, sql_query):
|
||||
result = {"data": [row_to_json(column_names, row) for row in rows]}
|
||||
return json_obj(result, column_names)
|
||||
else:
|
||||
# the SQL query returned no rows
|
||||
return json_obj({}, []) # return empty object
|
||||
result = {"data": []}
|
||||
return json_obj(result, column_names)
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user