Skip to content

Commit 8e39160

Browse files
committed
Added fix for distance if not available + added allow_empty option to true in verify_params
1 parent 571608b commit 8e39160

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

backend/PyMatcha/routes/api/search.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424

2525
@search_bp.route("/search", methods=["POST"])
26-
@validate_params(REQUIRED_PARAMS_SEARCH)
26+
@validate_params(REQUIRED_PARAMS_SEARCH, allow_empty=True)
2727
@jwt_required
2828
def search():
2929
data = request.get_json()
@@ -59,8 +59,9 @@ def search():
5959

6060
if max_distance != -1:
6161
distance = _get_distance(current_user.geohash, user.geohash)
62-
if distance > max_distance:
63-
continue
62+
if distance:
63+
if distance > max_distance:
64+
continue
6465

6566
if tags:
6667
user_tags = [t.name for t in user.get_tags()]

0 commit comments

Comments
 (0)