Merge pull request '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 th…' (#40) from ph4 into prod

Reviewed-on: #40
This commit is contained in:
mo 2025-06-01 19:56:27 +02:00
commit 088f371547

View File

@ -268,11 +268,14 @@ const selectGroup = (group: Group) => {
}; };
const openCreateListDialog = (group: Group) => { const openCreateListDialog = (group: Group) => {
// Ensure we have the latest groups data
fetchGroups().then(() => {
availableGroupsForModal.value = [{ availableGroupsForModal.value = [{
label: group.name, label: group.name,
value: group.id value: group.id
}]; }];
showCreateListModal.value = true; showCreateListModal.value = true;
});
}; };
const onListCreated = (newList: any) => { const onListCreated = (newList: any) => {
@ -280,6 +283,8 @@ const onListCreated = (newList: any) => {
message: `List '${newList.name}' created successfully.`, message: `List '${newList.name}' created successfully.`,
type: 'success' type: 'success'
}); });
// Optionally refresh the groups list to show the new list
fetchGroups();
}; };
onMounted(async () => { onMounted(async () => {