From 09e06591b2fbc3e3d81996204cfd34bd1c73db2f Mon Sep 17 00:00:00 2001 From: MohamedBassem Date: Sun, 6 Oct 2024 17:48:17 +0000 Subject: fix(web): Fix sidebar list edit dialog not working. Fixes #447 --- .../web/components/dashboard/lists/EditListModal.tsx | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'apps') diff --git a/apps/web/components/dashboard/lists/EditListModal.tsx b/apps/web/components/dashboard/lists/EditListModal.tsx index 993c975b..cba1a0e6 100644 --- a/apps/web/components/dashboard/lists/EditListModal.tsx +++ b/apps/web/components/dashboard/lists/EditListModal.tsx @@ -156,6 +156,11 @@ export function EditListModal({ const isEdit = !!list; const isPending = isCreating || isEditing; + const onSubmit = form.handleSubmit((value: z.infer) => { + value.parentId = value.parentId === "" ? null : value.parentId; + isEdit ? editList({ ...value, listId: list.id }) : createList(value); + }); + return ( {children}}
- { - value.parentId = value.parentId === "" ? null : value.parentId; - isEdit - ? editList({ ...value, listId: list.id }) - : createList(value); - })} - > + {isEdit ? "Edit" : "New"} List @@ -264,7 +262,11 @@ export function EditListModal({ Close - + {list ? "Save" : "Create"} -- cgit v1.2.3-70-g09d2