
            );
            
            const results = await Promise.all(promises);
            
            // Check if all were successful
            const allSuccessful = results.every(response => response.ok);
            
            if (allSuccessful) {
                // Success - close modal and refresh case list
                closeAddDeviceToCaseModal();
                
                // Refresh the cases list
                location.reload();
            } else {
                throw new 