Refactor database delete_session_history_rows ids

This commit is contained in:
JonnyWong16 2020-04-10 12:40:35 -07:00
parent 38f64c7d85
commit c979e78802
No known key found for this signature in database
GPG key ID: B1F1F9807184697A
3 changed files with 25 additions and 22 deletions

View file

@ -1871,12 +1871,14 @@ class WebInterface(object):
data_factory = datafactory.DataFactory()
if row_ids:
delete_row = data_factory.delete_session_history_rows(row_ids=row_ids)
success = database.delete_session_history_rows(row_ids=row_ids)
if delete_row:
return {'message': delete_row}
if success:
return {'result': 'success', 'message': 'Deleted history.'}
else:
return {'result': 'error', 'message': 'Failed to delete history.'}
else:
return {'message': 'No row ids received.'}
return {'result': 'error', 'message': 'No row ids received.'}
##### Graphs #####