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.

This commit is contained in:
mohamad 2025-06-01 19:56:11 +02:00
parent c6c204f64a
commit e52ab871bc

View File

@ -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 () => {