
            .then(response => response.json())
            .then(data => {
                    closeAddMemberModal();
                if (data.success) {
                    showMessage("Join request sent successfully!", false);
                } else {
                    showMessage(data.error || "Failed to send join request.", true);
                }
            })
            .catch(error => {
                console.error('Error:', error);
                showMessage("Failed to send join request. Ple