We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9e89b0b commit a89d34fCopy full SHA for a89d34f
templates/react-native/src/client.ts.twig
@@ -414,8 +414,9 @@ class Client {
414
415
try {
416
let data = null;
417
+ let text: string = '';
418
+
419
const response = await fetch(url.toString(), options);
- const text = await response.text()
420
421
const warnings = response.headers.get('x-{{ spec.title | lower }}-warning');
422
if (warnings) {
@@ -424,7 +425,9 @@ class Client {
424
425
426
if (response.headers.get('content-type')?.includes('application/json')) {
427
data = await response.json();
428
+ text = JSON.stringify(data);
429
} else {
430
+ text = await response.text();
431
data = {
432
message: text
433
};
0 commit comments