src/application/action-builder.js
function _dispatchFieldErrors({ node, callerId }, errorResult) {
    const isMultiNode = Array.isArray(node);
    const data = {};
    if (isMultiNode) {
        node.forEach((nd) => {
            data[nd] = (errorResult || {})[nd] || null;
        });
    } else {
        data[node] = errorResult;
    }

    const errorStatus = {
        name: 'error',
        isLoading: false
    };
    let newStatus = {};
    if (isMultiNode) {
        node.forEach((nd) => {
            newStatus[nd] = errorStatus;
        });
    } else {
        newStatus[node] = errorStatus;
    }
    dispatcher.handleServerAction({
        data,
        type: 'updateError',
        status: newStatus,
        callerId
    });
}
function _dispatchFieldErrors({ node, callerId }, errorResult) {
    const isMultiNode = Array.isArray(node);
    const data = {};
    if (isMultiNode) {
        node.forEach((nd) => {
            data[nd] = (errorResult || {})[nd] || null;
        });
    } else {
        data[node] = errorResult;
    }

    const errorStatus = {
        name: 'error',
        isLoading: false
    };
    let newStatus = {};
    if (isMultiNode) {
        node.forEach((nd) => {
            newStatus[nd] = errorStatus;
        });
    } else {
        newStatus[node] = errorStatus;
    }
    dispatcher.handleServerAction({
        data,
        type: 'updateError',
        status: newStatus,
        callerId
    });
}
function _dispatchFieldErrors ( { node , callerId } , errorResult ) { const isMultiNode = Array . isArray ( node ) ; const data = { } ; if ( isMultiNode ) { node . forEach ( ( nd ) => { data [ nd ] = ( errorResult || { } ) [ nd ] || null ; } ) ; } else { data [ node ] = errorResult ; } const errorStatus = { name : 'error' , isLoading : false } ; let newStatus = { } ; if ( isMultiNode ) { node . forEach ( ( nd ) => { newStatus [ nd ] = errorStatus ; } ) ; } else { newStatus [ node ] = errorStatus ; } dispatcher . handleServerAction ( { data , type : 'updateError' , status : newStatus , callerId } ) ; }
The main objective of this function is to cancel the loading state on all the nodes concerned by the service call.
@param {obejct} config Action builder config.
@param {object} errorResult Error returned.
The main objective of this function is to cancel the loading state on all the nodes concerned by the service call .