ase try again.", true);
            });
        }

        // Search users and display in dropdown for adding a new member
        function searchNewMember(query) {
            if (query.length < 2) {
                document.getElementById('newMemberDropdown').innerHTML = "";
                return;
            }

            fetch(`/teams/search-users/?query=${query}`)
                .then(response => response.json())
                .then(data => {
                    let dropdownContent = "";
         