diff --git a/server/main.py b/server/main.py index eb93636fd26f4c15cc492b41d8aecdd669c0a947..96c92a657a499c70b5611efe364cf3efa654a4bf 100644 --- a/server/main.py +++ b/server/main.py @@ -38,10 +38,7 @@ class IceHTTP(BaseHTTPRequestHandler): self.wfile.write(b"The root path provides no functionality. Please use a valid endpoint") elif self.path == '/update_map': # NB: should be POST? - get_all_markers(self, self.cursor, False, 'Mjosa') # Get all markers - # NB: temporary hardcoded waterBodyName - elif self.path == '/get_valid_markers': # NB: should be POST? - get_all_markers(self, self.cursor, True, 'Mjosa') # Get only valid markers + get_all_markers(self, self.cursor, 'Mjosa') # Get all markers # NB: temporary hardcoded waterBodyName elif self.path == '/get_relation': get_relation(self, 'Mjosa') # NB temp hardcoded value diff --git a/server/map/get_markers.py b/server/map/get_markers.py index 9274a01df75c6281ca50760e5d10b7159e679db9..7265270bb3a81f14eb3a413b53574119950ef0c7 100644 --- a/server/map/get_markers.py +++ b/server/map/get_markers.py @@ -3,7 +3,7 @@ import json # get_markers requests all marker data or valid markers, converts the data to json, and writes # the data to the response object -def get_all_markers(self, cursor, valid: bool, waterBodyName): +def get_all_markers(self, cursor, waterBodyName): try: sql_query = ''' SELECT m.MeasurementID, m.SensorID, m.TimeMeasured, m.CenterLat, m.CenterLon, @@ -19,9 +19,6 @@ def get_all_markers(self, cursor, valid: bool, waterBodyName): WHERE b.Name = 'Mjosa' ''' - if valid: # Append time restriction to WHERE statement, NB temporarily hardcoded to 5 days - sql_query += ' AND m.TimeMeasured > DATE_SUB(NOW(), INTERVAL 5 DAY)' - cursor.execute(sql_query) rows = cursor.fetchall() @@ -63,8 +60,7 @@ def get_all_markers(self, cursor, valid: bool, waterBodyName): 'Active': bool(row[6]) }, 'Subdivisions': [sub_division], # Array of sub_division objects - 'Corners': [], - # Returns list of corners calculated based on center coordinates + 'Corners': [], # NB remove value if not used } # Convert dictionary values to list of measurements