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:
devin-ai-integration[bot] 2026-09-07 12:24:04 -07:00 committed by GitHub
parent cc287a7d8f
commit c949843157
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 14 additions and 1 deletions

View file

@ -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);

View file

@ -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;
}