diff --git a/resources/views/form/rapport-team2/1794811995-cd07ffaa-1b76-40c8-800b-6b2d3c801016.blade.php b/resources/views/form/rapport-team2/1794811995-cd07ffaa-1b76-40c8-800b-6b2d3c801016.blade.php index 4ed2c3a5..c825624c 100644 --- a/resources/views/form/rapport-team2/1794811995-cd07ffaa-1b76-40c8-800b-6b2d3c801016.blade.php +++ b/resources/views/form/rapport-team2/1794811995-cd07ffaa-1b76-40c8-800b-6b2d3c801016.blade.php @@ -500,18 +500,26 @@ if (hierarcies.length > 0) { $("#pageloader").fadeIn(); let fetchedContacts = []; - + Promise.all( hierarcies.map(hierarchy => { + let tmUserId = $('#field-user_id option[hierarchy="' + hierarchy + '"]').val() || ''; return $.ajax({ type: "GET", url: '/form/getdoctorlist?partition={{$form->partition}}&hierarchy=' + hierarchy, processData: false, contentType: false }).then(data => { - if (Array.isArray(data)) { + /* if (Array.isArray(data)) { fetchedContacts = fetchedContacts.concat(data); - } + } */ + if (Array.isArray(data)) { + data.forEach(d => { + d.tm_user_id = tmUserId; + d.tm_hierarchy_id = hierarchy; + }); + fetchedContacts = fetchedContacts.concat(data); + } }).catch(function(err) { console.log("Error fetching doctors for hierarchy " + hierarchy, err); });