Skip to content

Commit bdfbb11

Browse files
added all_witnesses to query
1 parent 579f8cf commit bdfbb11

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

lib/woqlClient.js

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -464,17 +464,7 @@ WOQLClient.prototype.updateCSV = function(csv_path, commit_msg, gtype, gid) {
464464
WOQLClient.prototype.getCSV = function(csv_name, download, gtype, gid) {
465465
let options = {}, filePath
466466
options.name=csv_name;
467-
return this.dispatch(CONST.GET_CSV, this.connectionConfig.csvURL(gtype, gid), options).then(results => {
468-
if (download) {
469-
const url=window.URL.createObjectURL(new Blob([results]));
470-
const link=document.createElement('a');
471-
link.href = url;
472-
link.setAttribute('download', csv_name);
473-
document.body.appendChild(link);
474-
link.click();
475-
}
476-
return results;
477-
})
467+
return this.dispatch(CONST.GET_CSV, this.connectionConfig.csvURL(gtype, gid), options)
478468
}
479469

480470
/**
@@ -525,12 +515,14 @@ WOQLClient.prototype.info = function() {
525515
* @param {WOQLQuery} woql is a "woql query object"
526516
* @param {string} commit_msg - if the query contains any updates, it should include a textual message describing the reason for the update
527517
*/
528-
WOQLClient.prototype.query = function(woql, commit_msg) {
518+
WOQLClient.prototype.query = function(woql, commit_msg, all_witnesses) {
519+
all_witnesses = all_witnesses || false
529520
commit_msg = commit_msg || 'Commit generated with javascript client without message'
530521
if (woql && woql.json && (!woql.containsUpdate() || commit_msg)) {
531522
woql.context(this.connection.getContextForOutboundQuery(woql, this.db(), this.organization()))
532523
let doql = woql.containsUpdate() ? this.generateCommitInfo(commit_msg) : {}
533524
doql.query = woql.json()
525+
if(all_witnesses) doql.all_witnesses = true
534526
return this.dispatch(CONST.WOQL_QUERY, this.connectionConfig.queryURL(), doql)
535527
}
536528
let errmsg = `WOQL query parameter error`

0 commit comments

Comments
 (0)