From dcdbe09670ae2923badbb4120c2334c063176af3 Mon Sep 17 00:00:00 2001 From: Nidboj132 <28981031+Nidboj132@users.noreply.github.com> Date: Thu, 16 Nov 2023 20:26:21 +0100 Subject: fix: crash (#54) --- frontend/src/components/pages/profile.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'frontend/src/components/pages') diff --git a/frontend/src/components/pages/profile.js b/frontend/src/components/pages/profile.js index aa28546..041f585 100644 --- a/frontend/src/components/pages/profile.js +++ b/frontend/src/components/pages/profile.js @@ -125,10 +125,11 @@ function NavClick() { } } function UpdateProfile(){ - fetch(`/api/v1/profile`,{ + fetch(`https://lp.ardapektezol.com/api/v1/profile`,{ method: 'POST', headers: {Authorization: token} - }).then(r=>window.location.reload()) + }).then(r=>r.json()) + .then(d=>d.success?window.location.reload():window.alert(`Error: ${d.message}`)) } function TimeAgo(date) { @@ -221,7 +222,7 @@ return (
Cooperative - {profileData.rankings.cooperative.rank===0?"N/A":"#"+profileData.rankings.cooperative.rank+" "} + {profileData.rankings.cooperative.rank===0?"N/A ":"#"+profileData.rankings.cooperative.rank+" "} ({profileData.rankings.cooperative.completion_count}/{profileData.rankings.cooperative.completion_total})
@@ -285,7 +286,6 @@ return (
- {console.log(profileData)} {game == 0 && profileData !== null ? ( -- cgit v1.2.3