mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-20 00:11:50 +00:00
fix(ui): show the S3 label when editing the s3_v2 callback
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
6e7de5fd20
commit
251aeea97d
2 changed files with 5 additions and 4 deletions
|
|
@ -393,6 +393,7 @@ describe("Settings", () => {
|
|||
|
||||
const promptsOnlySwitch = await screen.findByRole("switch", { name: "Log Prompts Only" });
|
||||
expect(promptsOnlySwitch).not.toBeChecked();
|
||||
expect(within(screen.getByRole("dialog")).getByRole("combobox", { name: "Callback" })).toHaveValue("S3");
|
||||
|
||||
await user.click(promptsOnlySwitch);
|
||||
await user.click(within(screen.getByRole("dialog")).getByRole("button", { name: "Save Changes" }));
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ export const CallbackSelector: React.FC<CallbackSelectorProps> = ({
|
|||
}) => {
|
||||
const { control } = useFormContext<CallbackFormValues>();
|
||||
const inputId = React.useId();
|
||||
const selectedConfig = callbackConfigs.find((config) => config.id === selectedCallback) ?? null;
|
||||
const selectedConfig = findCallbackConfig(callbackConfigs, selectedCallback) ?? null;
|
||||
|
||||
return (
|
||||
<Controller
|
||||
|
|
@ -251,10 +251,10 @@ interface CallbackConfigWithParams {
|
|||
dynamic_params?: Record<string, DynamicParamConfig>;
|
||||
}
|
||||
|
||||
const findCallbackConfig = (
|
||||
callbackConfigs: readonly CallbackConfigWithParams[],
|
||||
const findCallbackConfig = <T extends { id: string }>(
|
||||
callbackConfigs: readonly T[],
|
||||
callbackName: string | null,
|
||||
): CallbackConfigWithParams | undefined => {
|
||||
): T | undefined => {
|
||||
if (!callbackName) {
|
||||
return undefined;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue