Skip to content

Commit 3f888fc

Browse files
authored
Merge pull request #337 from Seluj78/335-view-other-users
view other people v1
2 parents b36d25a + c70ff23 commit 3f888fc

File tree

23 files changed

+562
-67
lines changed

23 files changed

+562
-67
lines changed

backend/PyMatcha/routes/api/profile/report.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232

3333
@profile_report_bp.route("/profile/report/<uid>", methods=["POST"])
34-
@validate_params({"reason": str}, {"details": str})
34+
@validate_params({"reason": str})
3535
@jwt_required
3636
def report_profile(uid):
3737
data = request.get_json()
@@ -40,10 +40,7 @@ def report_profile(uid):
4040
if reason not in ["harassment", "bot", "spam", "inappropriate content"]:
4141
raise BadRequestError("Reason must be 'harassment', 'bot', 'spam' or 'inappropriate content'")
4242

43-
try:
44-
details = data["details"]
45-
except KeyError:
46-
details = None
43+
details = None
4744
try:
4845
u = get_user(uid)
4946
except NotFoundError:

backend/PyMatcha/routes/api/profile/view.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
from PyMatcha.models.user import get_user
2323
from PyMatcha.models.view import View
2424
from PyMatcha.utils.errors import NotFoundError
25+
from PyMatcha.utils.match_score import _get_distance
2526
from PyMatcha.utils.success import SuccessOutput
2627

2728
profile_view_bp = Blueprint("profile_view", __name__)
@@ -46,4 +47,8 @@ def view_profile(uid):
4647
if current_user.id != u.id:
4748
View.create(profile_id=u.id, viewer_id=current_user.id)
4849

49-
return SuccessOutput("profile", u.to_dict())
50+
user_dict = u.to_dict()
51+
# TODO: Update swagger with this
52+
user_dict["distance"] = _get_distance(current_user.geohash, u.geohash)
53+
54+
return SuccessOutput("profile", user_dict)

frontend/src/App.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<template>
22
<div id="app" class="antialiased" v-bind:style="{background: getBackground}">
3-
<router-view/>
3+
<keep-alive include="Browse,Search">
4+
<router-view/>
5+
</keep-alive>
46
</div>
57
</template>
68

frontend/src/assets/gender.png

7.65 KB
Loading

frontend/src/assets/like.png

7.81 KB
Loading
11.7 KB
Loading

frontend/src/assets/likeHover.png

8.28 KB
Loading

frontend/src/assets/location.png

6.06 KB
Loading

frontend/src/assets/superLike.png

11 KB
Loading
8.91 KB
Loading

0 commit comments

Comments
 (0)