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 ++++---- frontend/src/components/sidebar.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) 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 (