Refactor getData function and fix query bug

This commit is contained in:
sietse jonker
2024-04-01 14:41:02 +02:00
parent 650032fced
commit 4ab7709c82
2 changed files with 7 additions and 7 deletions

View File

@@ -49,9 +49,9 @@ def loginDB():
)
return mydb
def getData(node, dataType, MAC, dateStart, dateEnd):
def getData(node, dataType, MAC, dateStart, dateEnd, type):
mydb = loginDB()
query = get_query(node, dataType, MAC, False, False, dateStart, dateEnd)
query = get_query(node, dataType, MAC, dateStart, dateEnd, type)
cursor = mydb.cursor(dictionary=True) # Enable dictionary output
cursor.execute(query)
result = cursor.fetchall() # Fetch the results