title: conditional promise in Node js
body: <p>how to call conditional promise without nested promise and execute the rest of the code irrespective whether condition statisfy or not</p>
  
  <pre><code>        findAllByServiceProviderLocationId(serviceProviderLocationId, supplierId)
      .then(result =&gt; {
      // 1. set all the default values
      ChargesAdminController._setDefaultValues(result);
      //Based on some condition in result - i need to call new promise
      //If condition satisfy, do promise operation and continue executing. is there better way to do apart from nested promise`enter code here`
      //Ex:
      if(result.checkPricing){
          DBConnection.getPricing(result)
       }
          //some operations on result object before sending response - All these operations should run only after the conditional promise is fulfilled 
      })
  </code></pre>