Skip to content

Commit 48162bb

Browse files
committed
fix delete database
1 parent 040405d commit 48162bb

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

dist/terminus-client.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/terminus-client.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/woqlClient.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,18 +109,24 @@ WOQLClient.prototype.createDatabase = function (dburl, details, key) {
109109

110110
/**
111111
* Delete a Database
112-
* @param {string} dburl it is a terminusDB Url or a terminusDB Id
113-
* @param {object} opts no options are currently supported for this function
112+
* @param {String} dburl it is a terminusDB Url or a terminusDB Id
113+
* @param {String} key an optional API key
114114
* @return {Promise}
115115
*
116116
* if dburl is omitted, the current server and database will be used
117117
*/
118-
WOQLClient.prototype.deleteDatabase = function (dburl, opts) {
118+
WOQLClient.prototype.deleteDatabase = function (dburl, key) {
119119
if (dburl && !this.connectionConfig.setDB(dburl)) {
120120
return Promise.reject(
121121
new URIError(ErrorMessage.getInvalidURIMessage(dburl, 'Delete Database'))
122122
);
123123
}
124+
const opts = {};
125+
126+
if (key) {
127+
opts.key = key;
128+
}
129+
124130
const self = this;
125131
return this.dispatch(`${this.connectionConfig.dbURL()}`, CONST.DELETE_DATABASE, opts).then(
126132
(response) => {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@terminusdb/terminus-client",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "TerminusDB client library",
55
"main": "index.js",
66
"directories": {

0 commit comments

Comments
 (0)