Skip to content

Commit

Permalink
Stage 1: Final Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ManavTriv committed Mar 23, 2024
1 parent 232109e commit 2e7e463
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions spamoverflow/views/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,14 @@ def get_emails(customer_id):
query = Email.query.filter_by(customer_id=customer_id)

if start:
# Check if the start date can be converted to a datetime object
try:
start = datetime.fromisoformat(start)
except:
return jsonify({'error': 'Invalid query parameters'}), 400
query = query.filter(Email.created_at >= start)
if end:
# Check if the end date can be converted to a datetime object
try:
end = datetime.fromisoformat(end)
except:
Expand Down

0 comments on commit 2e7e463

Please # to comment.