From 5484abefebb0464158e872be7bbf44a2b1ac3aed Mon Sep 17 00:00:00 2001 From: lonkaars Date: Sat, 13 Mar 2021 14:07:19 +0100 Subject: remove request/friend works now --- api/social/destroy_relation.py | 1 + components/notificationsArea.tsx | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/api/social/destroy_relation.py b/api/social/destroy_relation.py index 1107024..aac6360 100644 --- a/api/social/destroy_relation.py +++ b/api/social/destroy_relation.py @@ -25,6 +25,7 @@ def index(): if relation == "none": return 403 remove_relation(user_1_id, user_2_id) + remove_relation(user_2_id, user_1_id) return "", 200 dynamic_route = ["/social", remove] diff --git a/components/notificationsArea.tsx b/components/notificationsArea.tsx index ab29f9c..86b90b7 100644 --- a/components/notificationsArea.tsx +++ b/components/notificationsArea.tsx @@ -89,7 +89,7 @@ function FriendRequest(props: { return !gone && { axios.request({ method: "post", - url: `/api/social/accept`, + url: "/api/social/accept", headers: {"content-type": "application/json"}, data: { "id": props.user?.id } }) @@ -97,7 +97,7 @@ function FriendRequest(props: { }} onDeny={() => { axios.request({ method: "post", - url: `/api/social/remove`, + url: "/api/social/remove", headers: {"content-type": "application/json"}, data: { "id": props.user?.id } }) -- cgit v1.2.3