File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -14,9 +14,9 @@ const Utils = {}
1414Utils . encodeURISegment = function ( str ) {
1515 if ( typeof str !== 'string' ) return str
1616 str = encodeURI ( str )
17- str = str . replaceAll ( '?' , '%3F' )
18- str = str . replaceAll ( '=' , '%3D' )
19- str = str . replaceAll ( '&' , '%26' )
17+ str = str . replace ( / \? / g , '%3F' )
18+ str = str . replace ( / = / g , '%3D' )
19+ str = str . replace ( / & / g , '%26' )
2020
2121 return str
2222}
Original file line number Diff line number Diff line change @@ -355,7 +355,7 @@ WOQLClient.prototype.connect = function(params) {
355355 if ( params ) this . connectionConfig . update ( params )
356356 // unset the current server setting until successful connect
357357 return this . dispatch ( CONST . GET , this . connectionConfig . apiURLInfo ( ) ) . then ( response => {
358- this . databases ( response )
358+ // this.databases(response)
359359 return response
360360 } )
361361}
@@ -620,7 +620,11 @@ WOQLClient.prototype.resetBranch = function(branchId, commitId) {
620620 * @returns {Promise } A promise that returns the call response object, or an Error if rejected.
621621 */
622622WOQLClient . prototype . optimizeBranch = function ( branchId ) {
623- return this . dispatch ( CONST . OPTIMIZE_SYSTEM , this . connectionConfig . optimizeBranchUrl ( branchId ) , { } )
623+ if ( branchId ) {
624+ return this . dispatch ( CONST . OPTIMIZE_SYSTEM , this . connectionConfig . optimizeBranchUrl ( branchId ) , { } )
625+ }
626+ let errmsg = `Branch parameter error - you must specify a valid branch id`
627+ return Promise . reject ( new Error ( ErrorMessage . getInvalidParameterMessage ( CONST . BRANCH , errmsg ) ) )
624628}
625629
626630/**
You can’t perform that action at this time.
0 commit comments