     return response.json();
            })
            .then(result => {
                if (result.error) {
                    throw new Error(result.error);
                }
                
                // Success - keep modal open and refresh case devices list
                
                // Don't close the modal, just refresh UI
                setTimeout(() => {
                    // Check which modal is open and update accordingly
                    const caseDevicesModal = document.getEl