Skip to content

Commit 8ee870f

Browse files
committed
fix formatting
Signed-off-by: Shoumi <shoumimukherjee@gmail.com>
1 parent 7e73916 commit 8ee870f

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

mcpgateway/static/admin.js

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8025,7 +8025,11 @@ async function handleGatewayTestSubmit(e) {
80258025

80268026
// Process body based on content type
80278027
let processedBody = bodyValidation.value;
8028-
if (contentType === "application/x-www-form-urlencoded" && bodyValidation.value && typeof bodyValidation.value === 'object') {
8028+
if (
8029+
contentType === "application/x-www-form-urlencoded" &&
8030+
bodyValidation.value &&
8031+
typeof bodyValidation.value === "object"
8032+
) {
80298033
// Convert JSON object to URL-encoded string
80308034
const params = new URLSearchParams();
80318035
Object.entries(bodyValidation.value).forEach(([key, value]) => {
@@ -17403,12 +17407,18 @@ document.head.appendChild(style);
1740317407

1740417408
// Function to update body label based on content type selection
1740517409
function updateBodyLabel() {
17406-
const bodyLabel = document.getElementById('gateway-test-body-label');
17407-
const contentType = document.getElementById('gateway-test-content-type')?.value;
17408-
17410+
const bodyLabel = document.getElementById("gateway-test-body-label");
17411+
const contentType = document.getElementById(
17412+
"gateway-test-content-type",
17413+
)?.value;
17414+
1740917415
if (bodyLabel) {
17410-
bodyLabel.innerHTML = contentType === 'application/x-www-form-urlencoded'
17411-
? 'Body (JSON)<br><small class="text-gray-500">Auto-converts to form data</small>'
17412-
: 'Body (JSON)';
17416+
bodyLabel.innerHTML =
17417+
contentType === "application/x-www-form-urlencoded"
17418+
? 'Body (JSON)<br><small class="text-gray-500">Auto-converts to form data</small>'
17419+
: "Body (JSON)";
1741317420
}
1741417421
}
17422+
17423+
// Make it available globally for HTML onclick handlers
17424+
window.updateBodyLabel = updateBodyLabel;

0 commit comments

Comments
 (0)