Skip to content

Commit ba7e6d3

Browse files
committed
import collections
1 parent aa74bd6 commit ba7e6d3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/dashboard/src/app/(layout)/services/import/parsePostman.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ function createServiceObject(postman: PostmanCollection): Tables<'services'> {
143143
function determineBaseUrl(postman: PostmanCollection): string {
144144
// Check for common base URL variable names
145145
const baseUrlVarNames = ['base_url', 'baseUrl', 'baseURL', 'BASE_URL', 'apiUrl', 'api_url', 'url', 'host'];
146-
let baseUrl = null;
147146

148147
// First check collection variables
149148
if (postman.variable && postman.variable.length > 0) {
@@ -468,6 +467,7 @@ function processItems(items: PostmanItem[], endpoints: Tables<'endpoints'>[], ba
468467
const urlObj = new URL(urlWithProtocol);
469468
path = urlObj.pathname;
470469
} catch (error) {
470+
console.error(error)
471471
// If URL parsing fails, try to extract path with regex
472472
const pathMatch = request.url.raw.match(/https?:\/\/[^\/]+(\/[^?#]*)/);
473473
if (pathMatch && pathMatch[1]) {
@@ -570,6 +570,7 @@ function processItems(items: PostmanItem[], endpoints: Tables<'endpoints'>[], ba
570570
});
571571
}
572572
} catch (e) {
573+
console.error(e);
573574
parameters.push({
574575
name: 'body',
575576
in: 'body',

0 commit comments

Comments
 (0)