From 124fa538eda9044c47ccd8653c0afacc1313186e Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Mon, 21 Apr 2025 19:10:15 -0700 Subject: [PATCH] fix(view_users.tsx): cleanup use effect hooks --- ui/litellm-dashboard/src/components/view_users.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ui/litellm-dashboard/src/components/view_users.tsx b/ui/litellm-dashboard/src/components/view_users.tsx index f178497537b..e409fea00a4 100644 --- a/ui/litellm-dashboard/src/components/view_users.tsx +++ b/ui/litellm-dashboard/src/components/view_users.tsx @@ -173,6 +173,7 @@ const ViewUserDashboard: React.FC = ({ if (data) { setUserListResponse(data); + console.log("called from debouncedSearch"); } } catch (error) { console.error("Error searching users:", error); @@ -270,7 +271,7 @@ const ViewUserDashboard: React.FC = ({ `userList_${currentPage}`, JSON.stringify(userDataResponse) ); - + console.log("called from refreshUserData"); setUserListResponse(userDataResponse); } catch (error) { console.error("Error refreshing user data:", error); @@ -288,6 +289,7 @@ const ViewUserDashboard: React.FC = ({ if (cachedUserData) { const parsedData = JSON.parse(cachedUserData); setUserListResponse(parsedData); + console.log("called from useEffect"); } else { // Fetch from API using userListCall with current filters const userDataResponse = await userListCall( @@ -307,6 +309,7 @@ const ViewUserDashboard: React.FC = ({ ); setUserListResponse(userDataResponse); + console.log("called from useEffect 2"); } // Fetch roles if not cached @@ -327,7 +330,7 @@ const ViewUserDashboard: React.FC = ({ fetchData(); } - }, [accessToken, token, userRole, userID, currentPage, filters]); + }, [accessToken, token, userRole, userID]); if (!userListResponse) { return
Loading...
;