Skip to content

Commit 3ff1996

Browse files
Merge pull request #91 from hoijnet/issue/optimize
Fix the broken branch optimize function
2 parents 339ab24 + aee376b commit 3ff1996

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

lib/connectionConfig.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ ConnectionConfig.prototype.commitDescriptorUrl = function(commitId) {
569569
ConnectionConfig.prototype.optimizeBranchUrl = function(branchId) {
570570
//let o = this.optimizeBase()
571571
const dbBase = this.dbBase('optimize')
572-
return `${dbBase}${this.repoid}/branch/${encodeURISegment(branchId)}`
572+
return `${dbBase}/${this.repoid}/branch/${encodeURIComponent(branchId)}`
573573
//return dbBase + `${this.user()}/${this.db()}/${this.repoid}/branch/${nuid}`
574574
}
575575

lib/woqlClient.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ WOQLClient.prototype.resetBranch = function(branchId, commitId) {
620620
* @returns {Promise} A promise that returns the call response object, or an Error if rejected.
621621
*/
622622
WOQLClient.prototype.optimizeBranch = function(branchId) {
623-
return this.dispatch(CONST.OPTIMIZE_SYSTEM, this.connectionConfig.optimizeBranchUrl(branchId))
623+
return this.dispatch(CONST.OPTIMIZE_SYSTEM, this.connectionConfig.optimizeBranchUrl(branchId), {})
624624
}
625625

626626
/**

test/connectionConfing.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ describe('connectionConfig tests', function() {
6666
})
6767

6868
it('check set branch', function() {
69-
const optimizeUrl = 'http://localhost:6363/api/optimize/admin/testDBlocal/branch/%23%23branch01'
69+
const optimizeUrl = 'http://localhost:6363/api/optimize/admin/testDB/local/branch/%23%23branch01'
7070
/*
7171
* the dbURL dosen't change
7272
*/

0 commit comments

Comments
 (0)