Skip to content

Commit 922acb4

Browse files
Vladlukhanindimaspirit
authored andcommitted
Fix for Fetch if a response is empty body
1 parent 4b8e3dd commit 922acb4

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

quickblox.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.

src/qbConfig.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
var config = {
1515
version: '2.8.0',
16-
buildNumber: '1058',
16+
buildNumber: '1059',
1717
creds: {
1818
appId: '',
1919
authKey: '',

src/qbProxy.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -126,18 +126,18 @@ ServiceProxy.prototype = {
126126
} else {
127127
return response.json();
128128
}
129-
})
130-
.then(function(body) {
131-
_requestCallback(null, qbResponse, body);
132-
})
133-
.catch(function(error) {
134-
// TODO: find status 200 for NativeScript
135-
if (typeof error === 'object' && !Object.keys(error).length) {
136-
_requestCallback(null, {status: 200}, ' ');
137-
} else {
138-
_requestCallback(error);
139-
}
140-
});
129+
}, function() {
130+
// Need to research this issue, response doesn't exist if server will return empty body (status 200)
131+
qbResponse = {
132+
status: 200
133+
};
134+
135+
return ' ';
136+
}).then(function(body) {
137+
_requestCallback(null, qbResponse, body);
138+
}, function(error) {
139+
_requestCallback(error);
140+
});
141141

142142
/*
143143
* Private functions

0 commit comments

Comments
 (0)