diff --git a/resources/views/form/rapport-team4/1788495344-e823f5ac-f7a7-477b-926f-62a066a6c718.blade.php b/resources/views/form/rapport-team4/1788495344-e823f5ac-f7a7-477b-926f-62a066a6c718.blade.php index b3146fe5..e7cf47f8 100644 --- a/resources/views/form/rapport-team4/1788495344-e823f5ac-f7a7-477b-926f-62a066a6c718.blade.php +++ b/resources/views/form/rapport-team4/1788495344-e823f5ac-f7a7-477b-926f-62a066a6c718.blade.php @@ -58,7 +58,10 @@ } } - $historyDoctorIds = array_unique($historyDoctorIds); + /* $historyDoctorIds = array_unique($historyDoctorIds); */ + + $historyDoctorIds = array_values(array_unique($historyDoctorIds)); + @endphp @@ -299,7 +302,9 @@ $('#field-legacy_code').val($('option:selected', this).attr('msl_code')); }); - let historyDoctorIds = @json($historyDoctorIds).map(String); + /* let historyDoctorIds = @json($historyDoctorIds).map(String); */ + let rawHistory = @json($historyDoctorIds); +let historyDoctorIds = (Array.isArray(rawHistory) ? rawHistory : Object.values(rawHistory || {})).map(String); console.log("HISTORY DOCTOR IDS:", historyDoctorIds); // 🔥 NEW - Disable doctors that were already submitted // NEW - DEBUG duplicate doctor check