From e52ab871bc71f0521bc1a0aa37fc375299eb776a Mon Sep 17 00:00:00 2001 From: mohamad Date: Sun, 1 Jun 2025 19:56:11 +0200 Subject: [PATCH] Enhance group selection flow by ensuring latest groups data is fetched before opening the create list dialog. Additionally, refresh the groups list after a new list is created to reflect updates. This improves data consistency and user experience on the GroupsPage. --- fe/src/pages/GroupsPage.vue | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/fe/src/pages/GroupsPage.vue b/fe/src/pages/GroupsPage.vue index 5f14579..edc157e 100644 --- a/fe/src/pages/GroupsPage.vue +++ b/fe/src/pages/GroupsPage.vue @@ -268,11 +268,14 @@ const selectGroup = (group: Group) => { }; const openCreateListDialog = (group: Group) => { - availableGroupsForModal.value = [{ - label: group.name, - value: group.id - }]; - showCreateListModal.value = true; + // Ensure we have the latest groups data + fetchGroups().then(() => { + availableGroupsForModal.value = [{ + label: group.name, + value: group.id + }]; + showCreateListModal.value = true; + }); }; const onListCreated = (newList: any) => { @@ -280,6 +283,8 @@ const onListCreated = (newList: any) => { message: `List '${newList.name}' created successfully.`, type: 'success' }); + // Optionally refresh the groups list to show the new list + fetchGroups(); }; onMounted(async () => {