Skip to content

Commit c3f8491

Browse files
author
Igor Khomenko
committed
removed QB.data.updateFile
1 parent 4bf0194 commit c3f8491

File tree

4 files changed

+9
-41
lines changed

4 files changed

+9
-41
lines changed

js/modules/qbData.js

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -81,20 +81,6 @@ DataProxy.prototype = {
8181
});
8282
},
8383

84-
updateFile: function(className, params, callback) {
85-
Utils.QBLog('[DataProxy]', 'updateFile', className, params);
86-
87-
var formData;
88-
formData = new FormData();
89-
formData.append('field_name', params.field_name);
90-
formData.append('file', params.file);
91-
this.service.ajax({url: Utils.getUrl(config.urls.data, className + '/' + params.id + '/file'), data: formData,
92-
contentType: false, processData: false, type: 'POST'}, function(err, result) {
93-
if (err) { callback (err, null); }
94-
else { callback (err, result); }
95-
});
96-
},
97-
9884
downloadFile: function(className, params, callback) {
9985
Utils.QBLog('[DataProxy]', 'downloadFile', className, params);
10086

quickblox.min.js

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/users.zip

-4.37 KB
Binary file not shown.

spec/QB-DataSpec.js

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -115,22 +115,6 @@ describe('Сustom Objects API', function() {
115115
});
116116
});
117117

118-
it ('can update a file in existing record', function(done){
119-
paramsFile.file = new File(["Hello QuickBlox cars"], "volvo.txt", {type: "text/plain",
120-
lastModified: new Date(2015, 10, 19, 17, 00, 00, 600)});
121-
122-
QB.data.updateFile('cars', paramsFile, function(err, res) {
123-
if (err) {
124-
done.fail("Upload a file to an existing record error: " + JSON.stringify(err));
125-
} else {
126-
expect(res).not.toBeNull();
127-
expect(res.name).toBe("volvo.txt");
128-
console.info('can update a file in existing record');
129-
done();
130-
}
131-
});
132-
});
133-
134118
it ('can dawnload a file from existing record', function(done){
135119
paramsFor = {
136120
id: paramsFile.id,
@@ -203,5 +187,3 @@ describe('Сustom Objects API', function() {
203187
});
204188

205189
});
206-
207-

0 commit comments

Comments
 (0)