mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-09 22:31:41 +00:00
fix(ui): send empty vector_stores when the last team vector store is removed (#40144)
Co-authored-by: yassin <yassin@berri.ai> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
cc287a7d8f
commit
c949843157
2 changed files with 14 additions and 1 deletions
|
|
@ -2052,6 +2052,19 @@ describe("TeamInfoView - the exact bytes the update call sends", () => {
|
|||
expect(objectPermission.agent_access_groups).toStrictEqual([]);
|
||||
});
|
||||
|
||||
it("sends an empty vector_stores array after the last vector store chip is removed", async () => {
|
||||
const user = userEvent.setup({ delay: null });
|
||||
await openEditor(user);
|
||||
|
||||
await user.click(within(screen.getByLabelText("vs-1")).getByRole("button"));
|
||||
expect(screen.queryByLabelText("vs-1")).not.toBeInTheDocument();
|
||||
|
||||
const payload = await save(user);
|
||||
|
||||
const objectPermission = wireBody(payload).object_permission as Record<string, unknown>;
|
||||
expect(objectPermission.vector_stores).toStrictEqual([]);
|
||||
});
|
||||
|
||||
it("resends every stored value once both sections are opened", async () => {
|
||||
const user = userEvent.setup({ delay: null });
|
||||
await openEditor(user);
|
||||
|
|
|
|||
|
|
@ -1039,7 +1039,7 @@ const TeamInfoView: React.FC<TeamInfoProps> = ({
|
|||
delete values.agents_and_groups;
|
||||
|
||||
// Handle vector stores permissions
|
||||
if (values.vector_stores && values.vector_stores.length > 0) {
|
||||
if (values.vector_stores) {
|
||||
updateData.object_permission.vector_stores = values.vector_stores;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue