Skip to content

Commit

Permalink
Revert "Merge pull request #1 from montmanu/s3file-delete"
Browse files Browse the repository at this point in the history
This reverts commit 71cf82c, reversing
changes made to 6966718.

Conflicts:
	fields/types/s3file/S3FileType.js
  • Loading branch information
montmanu committed Mar 13, 2015
1 parent 9dba96d commit cbd341e
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions fields/types/s3file/S3FileType.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,6 @@ s3file.prototype.addToSchema = function() {
url: ''
});
};

var del = function(item){
try {
var client = knox.createClient(field.s3config);
client.deleteFile(item.get(paths.path) + item.get(paths.filename), function(err, res){ return res ? res.resume() : false; });
} catch(e) {}
reset(item);
};

var schemaMethods = {
exists: function() {
Expand All @@ -155,9 +147,6 @@ s3file.prototype.addToSchema = function() {
* @api public
*/
reset: function() {
if (exists(this)){
return del(this);
}
reset(this);
},
/**
Expand All @@ -166,7 +155,11 @@ s3file.prototype.addToSchema = function() {
* @api public
*/
delete: function() {
del(this);
try {
var client = knox.createClient(field.s3config);
client.deleteFile(this.get(paths.path) + this.get(paths.filename), function(err, res){ return res ? res.resume() : false; });
} catch(e) {}
reset(this);
}
};

Expand Down Expand Up @@ -439,7 +432,6 @@ s3file.prototype.uploadFile = function(item, file, update, callback) {
};

if (update) {
field.apply(item, 'reset');
item.set(field.path, fileData);
}

Expand Down

0 comments on commit cbd341e

Please sign in to comment.