From 213b4ca6d16501e90e69f4055b43199fb445549b Mon Sep 17 00:00:00 2001 From: Erik Jan de Wit Date: Mon, 1 Jul 2024 10:49:04 +0200 Subject: [PATCH] reset form instead of adding to it (#30650) fixes: #30550 Signed-off-by: Erik Jan de Wit --- js/apps/admin-ui/src/groups/GroupAttributes.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/js/apps/admin-ui/src/groups/GroupAttributes.tsx b/js/apps/admin-ui/src/groups/GroupAttributes.tsx index d7d78db60d..a0e4c2bcd9 100644 --- a/js/apps/admin-ui/src/groups/GroupAttributes.tsx +++ b/js/apps/admin-ui/src/groups/GroupAttributes.tsx @@ -15,7 +15,7 @@ import { AttributesForm, } from "../components/key-value-form/AttributeForm"; import { arrayToKeyValue } from "../components/key-value-form/key-value-convert"; -import { convertFormValuesToObject, convertToFormValues } from "../util"; +import { convertFormValuesToObject } from "../util"; import { useFetch } from "../utils/useFetch"; import { getLastId } from "./groupIdUtils"; @@ -35,7 +35,9 @@ export const GroupAttributes = () => { useFetch( () => adminClient.groups.findOne({ id }), (group) => { - convertToFormValues(group!, form.setValue); + form.reset({ + attributes: arrayToKeyValue(group?.attributes!), + }); setCurrentGroup(group); }, [id],