@@ -392,10 +392,16 @@ proto.modifyReleasePackage = function(packageId, params) {
392392 }
393393 var new_params = {
394394 description : description || packageInfo . description ,
395- is_mandatory : isMandatory ? constConfig . IS_MANDATORY_YES : constConfig . IS_MANDATORY_NO ,
396- is_disabled : isDisabled ? constConfig . IS_DISABLED_YES : constConfig . IS_DISABLED_NO ,
397- rollout : rollout || 100
398395 } ;
396+ if ( _ . isInteger ( rollout ) ) {
397+ new_params . rollout = rollout ;
398+ }
399+ if ( _ . isBoolean ( isMandatory ) ) {
400+ new_params . is_mandatory = isMandatory ? constConfig . IS_MANDATORY_YES : constConfig . IS_MANDATORY_NO ;
401+ }
402+ if ( _ . isBoolean ( isDisabled ) ) {
403+ new_params . is_disabled = isDisabled ? constConfig . IS_DISABLED_YES : constConfig . IS_DISABLED_NO ;
404+ }
399405 return models . Packages . update ( new_params , { where : { id : packageId } } ) ;
400406 } ) ;
401407} ;
@@ -447,14 +453,22 @@ proto.promotePackage = function (sourceDeploymentId, destDeploymentId, params) {
447453 var create_params = {
448454 releaseMethod : constConfig . RELEAS_EMETHOD_PROMOTE ,
449455 releaseUid : params . promoteUid || 0 ,
450- isMandatory : params . isMandatory ? constConfig . IS_MANDATORY_YES : constConfig . IS_MANDATORY_NO ,
451- isDisabled : params . isDisabled ? constConfig . IS_DISABLED_YES : constConfig . IS_DISABLED_NO ,
452- rollout : params . rollout || packages . rollout ,
456+ rollout : params . rollout || 100 ,
453457 size : packages . size ,
454- description : packages . description ,
458+ description : params . description || packages . description ,
455459 originalLabel : packages . label ,
456460 originalDeployment : sourceDeployment . name
457461 } ;
462+ if ( _ . isBoolean ( isMandatory ) ) {
463+ create_params . is_mandatory = params . isMandatory ? constConfig . IS_MANDATORY_YES : constConfig . IS_MANDATORY_NO ;
464+ } else {
465+ create_params . is_mandatory = packages . is_mandatory
466+ }
467+ if ( _ . isBoolean ( isDisabled ) ) {
468+ create_params . is_disabled = params . isDisabled ? constConfig . IS_DISABLED_YES : constConfig . IS_DISABLED_NO ;
469+ } else {
470+ create_params . is_disabled = packages . is_disabled
471+ }
458472 return self . createPackage ( destDeploymentId , deploymentsVersions . app_version , packages . package_hash , packages . manifest_blob_url , packages . blob_url , create_params ) ;
459473 } ) ;
460474} ;
0 commit comments