Add method 'createItem' to DB plugins
This commit is contained in:
parent
126a57d5ab
commit
5eade81294
4 changed files with 34 additions and 0 deletions
|
|
@ -95,6 +95,16 @@ GoogleDrive.prototype._httpGet = function(theUrl) {
|
|||
return xmlHttp.responseText;
|
||||
}
|
||||
|
||||
GoogleDrive.prototype.createItem = function(name, value, callback) {
|
||||
this.getItem(name, function(err, retrieved) {
|
||||
if (err || !retrieved) {
|
||||
return this.setItem(name, value, callback);
|
||||
} else {
|
||||
return callback('EEXISTS');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
GoogleDrive.prototype.getItem = function(k, cb) {
|
||||
//console.log('[googleDrive.js.95:getItem:]', k); //TODO
|
||||
var self = this;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue