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
@@ -264,22 +264,28 @@ export default class ApiEditDialogComponent implements OnInit {
|
|
264 |
|
265 |
try {
|
266 |
body_template = formValue.body_template ? JSON.parse(formValue.body_template) : {};
|
267 |
-
} catch {
|
|
|
|
|
268 |
|
269 |
try {
|
270 |
auth_token_request_body = formValue.auth.token_request_body ? JSON.parse(formValue.auth.token_request_body) : {};
|
271 |
-
} catch {
|
|
|
|
|
272 |
|
273 |
try {
|
274 |
auth_token_refresh_body = formValue.auth.token_refresh_body ? JSON.parse(formValue.auth.token_refresh_body) : {};
|
275 |
-
} catch {
|
|
|
|
|
276 |
|
277 |
// Prepare final data
|
278 |
const apiData: any = {
|
279 |
name: formValue.name,
|
280 |
url: formValue.url,
|
281 |
method: formValue.method,
|
282 |
-
headers,
|
283 |
body_template,
|
284 |
timeout_seconds: formValue.timeout_seconds,
|
285 |
retry: formValue.retry,
|
|
|
264 |
|
265 |
try {
|
266 |
body_template = formValue.body_template ? JSON.parse(formValue.body_template) : {};
|
267 |
+
} catch (e) {
|
268 |
+
console.error('Invalid body_template JSON:', e);
|
269 |
+
}
|
270 |
|
271 |
try {
|
272 |
auth_token_request_body = formValue.auth.token_request_body ? JSON.parse(formValue.auth.token_request_body) : {};
|
273 |
+
} catch (e) {
|
274 |
+
console.error('Invalid auth token_request_body JSON:', e);
|
275 |
+
}
|
276 |
|
277 |
try {
|
278 |
auth_token_refresh_body = formValue.auth.token_refresh_body ? JSON.parse(formValue.auth.token_refresh_body) : {};
|
279 |
+
} catch (e) {
|
280 |
+
console.error('Invalid auth token_refresh_body JSON:', e);
|
281 |
+
}
|
282 |
|
283 |
// Prepare final data
|
284 |
const apiData: any = {
|
285 |
name: formValue.name,
|
286 |
url: formValue.url,
|
287 |
method: formValue.method,
|
288 |
+
headers, // Now it's a dictionary object
|
289 |
body_template,
|
290 |
timeout_seconds: formValue.timeout_seconds,
|
291 |
retry: formValue.retry,
|