Skip to content

Commit 7d8db35

Browse files
committed
adding commit msg to delete csv
1 parent 87136cb commit 7d8db35

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

lib/viewer/tableConfig.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const UTILS = require('../utils.js');
44

55

66
function WOQLTableConfig(){
7-
Config.ViewConfig.call(this);
7+
Config.ViewConfig.call(this);
88
this.type = "table";
99
}
1010

@@ -99,10 +99,10 @@ WOQLTableConfig.prototype.prettyPrint = function(){
9999
if(typeof this.changesize() != "undefined"){
100100
str += "view.changesize(" + this.changesize() + ")\n";
101101
}
102-
102+
103103
for(var i = 0; i<this.rules.length ; i++){
104104
let x = this.rules[i].prettyPrint();
105-
if(x) str += "view." + x + "\n";
105+
if(x) str += "view." + x + "\n";
106106
}
107107
return str;
108108
}
@@ -175,9 +175,9 @@ WOQLTableConfig.prototype.row = function(){
175175
* Table
176176
*/
177177

178-
178+
179179
function WOQLTableRule(){
180-
Config.WOQLViewRule.call(this);
180+
Config.WOQLViewRule.call(this);
181181
};
182182

183183
WOQLTableRule.prototype = Object.create(Config.WOQLViewRule.prototype);
@@ -256,4 +256,4 @@ WOQLTableRule.prototype.prettyPrint = function(type){
256256
return str;
257257
}
258258

259-
module.exports = WOQLTableConfig;
259+
module.exports = WOQLTableConfig;

lib/woqlClient.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ WOQLClient.prototype.updateCSV = function(csv, commitMsg, gtype, gid) {
440440
let commit = this.generateCommitInfo(commitMsg)
441441
const formData = new FormData();
442442
csv.map((item)=>{
443-
formData.append(item.name, item)
443+
formData.append(item.fileToBeUpdated, item.updateWith)
444444
})
445445
formData.append('payload', JSON.stringify(commit))
446446
return this.dispatch(
@@ -486,12 +486,15 @@ WOQLClient.prototype.getCSV = function(csvName, download, gtype, gid) {
486486
* @param {string} gid TerminusDB Graph ID to update, main is the default value
487487
* @return {Promise} An API success message
488488
*/
489-
WOQLClient.prototype.deleteCSV = function(csvName, gtype, gid) {
490-
let options = {}, filePath
491-
options.name=csvName;
492-
return this.dispatch(CONST.DELETE_CSV, this.connectionConfig.csvURL(gtype, gid), options).then(results => {
489+
WOQLClient.prototype.deleteCSV = function(csvName, commitMsg, gtype, gid) {
490+
if (commitMsg && csv) {
491+
let commit = this.generateCommitInfo(commitMsg)
492+
let options = {}, filePath
493+
options.name=csvName;
494+
return this.dispatch(CONST.DELETE_CSV, this.connectionConfig.csvURL(gtype, gid), options).then(results => {
493495
return results;
494496
})
497+
}
495498
}
496499

497500
/**

0 commit comments

Comments
 (0)