ui - v0 show users callbacks set

This commit is contained in:
Ishaan Jaff 2024-04-08 16:01:04 -07:00
parent 3ee345477e
commit 7c315d25b4
3 changed files with 94 additions and 29 deletions

View file

@ -1120,3 +1120,42 @@ export const slackBudgetAlertsHealthCheck = async (accessToken: String) => {
}
};
export const getCallbacksCall = async (
accessToken: String,
userID: String,
userRole: String
) => {
/**
* Get all the models user has access to
*/
try {
let url = proxyBaseUrl ? `${proxyBaseUrl}/get/config/callbacks` : `/get/config/callbacks`;
//message.info("Requesting model data");
const response = await fetch(url, {
method: "GET",
headers: {
Authorization: `Bearer ${accessToken}`,
"Content-Type": "application/json",
},
});
if (!response.ok) {
const errorData = await response.text();
message.error(errorData);
throw new Error("Network response was not ok");
}
const data = await response.json();
//message.info("Received model 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 get callbacks:", error);
throw error;
}
};