From 41580eedeff73a48a7f4674c50f1c2406dbe2719 Mon Sep 17 00:00:00 2001 From: dreth Date: Fri, 9 Aug 2024 15:03:44 +0200 Subject: [PATCH] fix bdays dashboard for new users --- frontend/app/dashboard/page.tsx | 6 ++++-- frontend/lib/api/apiService.js | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend/app/dashboard/page.tsx b/frontend/app/dashboard/page.tsx index b7d0d65..aed0729 100644 --- a/frontend/app/dashboard/page.tsx +++ b/frontend/app/dashboard/page.tsx @@ -336,8 +336,10 @@ export default function Dashboard() { try { const response = await getUserData(token); const birthdays = response.birthdays; - setOriginalBirthdays(birthdays); - setBirthdays(birthdays); + if (birthdays) { + setOriginalBirthdays(birthdays); + setBirthdays(birthdays); + } } catch (error) { console.error("Error fetching user data", error); } diff --git a/frontend/lib/api/apiService.js b/frontend/lib/api/apiService.js index e830b72..dfc7616 100644 --- a/frontend/lib/api/apiService.js +++ b/frontend/lib/api/apiService.js @@ -5,7 +5,7 @@ const prefix = "/api"; // Create an Axios instance const api = axios.create({ // UNCOMMENT THE LINE BELOW FOR LOCAL TESTING - // baseURL: "http://localhost:8418", + // baseURL: "http://localhost:8417", headers: { "Content-Type": "application/json", },