HTML/js/ai-events.js
/**
 * load all of the members in the network for use in the different user experiences. This routine is designed for use if the network has been newly deployed and the web app was
 * started before the autoLoad function was run on the newly deployed network (which, by default, is empty).
 * @returns {Promise} - promise upon completino of loadding member objects.
 */
load all of the members in the network for use in the different user experiences. This routine is designed for use if the network has been newly deployed and the web app was
started before the autoLoad function was run on the newly deployed network (which, by default, is empty).
@returns {Promise} - promise upon completino of loadding member objects.
load all of the members in the network for use in the different user experiences . This routine is designed for use if the network has been newly deployed and the web app was started before the autoLoad function was run on the newly deployed network ( which by default is empty ) . @returns { Promise } - promise upon completino of loadding member objects .
function deferredMemberLoad()
{
    let d_prompts = $.Deferred();
    let options = {};
    options.registry = 'Manufacturer';
    let options2 = {};
    options2.registry = 'Retailer';
    let options3 = {};
    options3.registry = 'AgricultureOrganisation';
    let options4 = {};
    options4.registry = 'FinanceCo';
    let options5 = {};
    options5.registry = 'Customer';
    $.when($.post('/composer/admin/getMembers', options), $.post('/composer/admin/getMembers', options2),
        $.post('/composer/admin/getMembers', options3), $.post('/composer/admin/getMembers', options4), $.post('/composer/admin/getMembers', options5)).done(function (_manufacturer, _retailers, _agriOrgs, _financeCos, _customers){
            retailers = _retailers[0].members;
            manufacturer = _manufacturer[0].members;
            m_string = _getMembers(manufacturer);
            agriOrgs = _agriOrgs[0].members;
            ao_string = _getMembers(agriOrgs);
            financeCos = _financeCos[0].members;
            fc_string = _getMembers(financeCos);
            customers = _customers[0].members;
            c_string = _getMembers(customers);
            retailers = _retailers[0].members;
            r_string = _getMembers(retailers);
            d_prompts.resolve();
        }).fail(d_prompts.reject);
    return d_prompts.promise();
}
function deferredMemberLoad ( ) { let d_prompts = $ . Deferred ( ) ; let options = { } ; options . registry = 'Manufacturer' ; let options2 = { } ; options2 . registry = 'Retailer' ; let options3 = { } ; options3 . registry = 'AgricultureOrganisation' ; let options4 = { } ; options4 . registry = 'FinanceCo' ; let options5 = { } ; options5 . registry = 'Customer' ; $ . when ( $ . post ( '/composer/admin/getMembers' , options ) , $ . post ( '/composer/admin/getMembers' , options2 ) , $ . post ( '/composer/admin/getMembers' , options3 ) , $ . post ( '/composer/admin/getMembers' , options4 ) , $ . post ( '/composer/admin/getMembers' , options5 ) ) . done ( function ( _manufacturer , _retailers , _agriOrgs , _financeCos , _customers ) { retailers = _retailers [ 0 ] . members ; manufacturer = _manufacturer [ 0 ] . members ; m_string = _getMembers ( manufacturer ) ; agriOrgs = _agriOrgs [ 0 ] . members ; ao_string = _getMembers ( agriOrgs ) ; financeCos = _financeCos [ 0 ] . members ; fc_string = _getMembers ( financeCos ) ; customers = _customers [ 0 ] . members ; c_string = _getMembers ( customers ) ; retailers = _retailers [ 0 ] . members ; r_string = _getMembers ( retailers ) ; d_prompts . resolve ( ) ; } ) . fail ( d_prompts . reject ) ; return d_prompts . promise ( ) ; }
load all of the members in the network for use in the different user experiences.
load all of the members in the network for use in the different user experiences .