Spaces:
Running
Running
Update flare-ui/src/app/dialogs/api-edit-dialog/api-edit-dialog.component.ts
Browse files
flare-ui/src/app/dialogs/api-edit-dialog/api-edit-dialog.component.ts
CHANGED
@@ -344,7 +344,7 @@ export default class ApiEditDialogComponent implements OnInit {
|
|
344 |
|
345 |
return processed;
|
346 |
}
|
347 |
-
|
348 |
async testAPI() {
|
349 |
const generalValid = this.form.get('url')?.valid && this.form.get('method')?.valid;
|
350 |
if (!generalValid) {
|
@@ -373,6 +373,16 @@ export default class ApiEditDialogComponent implements OnInit {
|
|
373 |
testData.test_request = testRequestData;
|
374 |
|
375 |
const result = await this.apiService.testAPI(testData).toPromise();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
376 |
this.testResult = result;
|
377 |
|
378 |
if (result.success) {
|
@@ -399,7 +409,7 @@ export default class ApiEditDialogComponent implements OnInit {
|
|
399 |
this.testing = false;
|
400 |
}
|
401 |
}
|
402 |
-
|
403 |
updateTestRequestJson() {
|
404 |
const formValue = this.form.getRawValue();
|
405 |
let bodyTemplate = {};
|
|
|
344 |
|
345 |
return processed;
|
346 |
}
|
347 |
+
|
348 |
async testAPI() {
|
349 |
const generalValid = this.form.get('url')?.valid && this.form.get('method')?.valid;
|
350 |
if (!generalValid) {
|
|
|
373 |
testData.test_request = testRequestData;
|
374 |
|
375 |
const result = await this.apiService.testAPI(testData).toPromise();
|
376 |
+
|
377 |
+
// Response headers'ı obje olarak sakla
|
378 |
+
if (result.response_headers && typeof result.response_headers === 'string') {
|
379 |
+
try {
|
380 |
+
result.response_headers = JSON.parse(result.response_headers);
|
381 |
+
} catch {
|
382 |
+
// Headers parse edilemezse string olarak bırak
|
383 |
+
}
|
384 |
+
}
|
385 |
+
|
386 |
this.testResult = result;
|
387 |
|
388 |
if (result.success) {
|
|
|
409 |
this.testing = false;
|
410 |
}
|
411 |
}
|
412 |
+
|
413 |
updateTestRequestJson() {
|
414 |
const formValue = this.form.getRawValue();
|
415 |
let bodyTemplate = {};
|