From cdb06d7ef0d31ac76280dbf8183e81abf96016c3 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Fri, 29 Mar 2024 15:53:28 -0700 Subject: [PATCH] (ui) /team/delete call --- .../src/components/networking.tsx | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/ui/litellm-dashboard/src/components/networking.tsx b/ui/litellm-dashboard/src/components/networking.tsx index f0bf965c6d..eced60d6dc 100644 --- a/ui/litellm-dashboard/src/components/networking.tsx +++ b/ui/litellm-dashboard/src/components/networking.tsx @@ -165,6 +165,37 @@ export const keyDeleteCall = async (accessToken: String, user_key: String) => { } }; +export const teamDeleteCall = async (accessToken: String, teamID: String) => { + try { + const url = proxyBaseUrl ? `${proxyBaseUrl}/team/delete` : `/team/delete`; + console.log("in teamDeleteCall:", teamID); + const response = await fetch(url, { + method: "POST", + headers: { + Authorization: `Bearer ${accessToken}`, + "Content-Type": "application/json", + }, + body: JSON.stringify({ + team_ids: [teamID], + }), + }); + + if (!response.ok) { + const errorData = await response.text(); + message.error("Failed to delete team: " + errorData); + throw new Error("Network response was not ok"); + } + const data = await response.json(); + console.log(data); + return data; + // Handle success - you might want to update some state or UI based on the created key + } catch (error) { + console.error("Failed to delete key:", error); + throw error; + } + +} + export const userInfoCall = async ( accessToken: String, userID: String | null,