diff --git a/server/src/server_api.py b/server/src/server_api.py index 2dde3b8..726c031 100644 --- a/server/src/server_api.py +++ b/server/src/server_api.py @@ -133,11 +133,10 @@ def get_all_records(): # Route to get records since a given timestamp @app.route( - '/get_records_since/', + '/get_records_since/', methods=['GET'] ) -def get_records_since(timestamp_str): - timestamp = parse_timestamp(timestamp_str) +def get_records_since(timestamp): if timestamp is None: return jsonify({'error': 'Invalid timestamp format'}), 400 @@ -162,13 +161,11 @@ def get_records_since(timestamp_str): # Route to get records between two timestamps @app.route( '/get_records_between/' - '/', + '/', methods=['GET'] ) -def get_records_between(start_timestamp_str, end_timestamp_str): +def get_records_between(start_timestamp, end_timestamp): # Parse the provided start and end timestamps into datetime objects - start_timestamp = parse_timestamp(start_timestamp_str) - end_timestamp = parse_timestamp(end_timestamp_str) if start_timestamp is None or end_timestamp is None: return jsonify({'error': 'Invalid timestamp format'}), 400 @@ -189,9 +186,8 @@ def get_records_between(start_timestamp_str, end_timestamp_str): return jsonify(records_list) # Route to get records until a given timestamp -@app.route('/get_records_until/', methods=['GET']) -def get_records_until(timestamp_str): - timestamp = parse_timestamp(timestamp_str) +@app.route('/get_records_until/', methods=['GET']) +def get_records_until(timestamp): if timestamp is None: return jsonify({'error': 'Invalid timestamp format'}), 400