mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-25 02:08:28 +02:00
Fix Postman import description
https://feedback.yaak.app/p/missing-documentation-info-when-importing-postman-requests
This commit is contained in:
@@ -83,10 +83,12 @@ export function convertPostman(contents: string): ImportPluginResponse | undefin
|
|||||||
};
|
};
|
||||||
exportResources.environments.push(environment);
|
exportResources.environments.push(environment);
|
||||||
|
|
||||||
|
let sortPriorityIndex = 0;
|
||||||
const importItem = (v: Record<string, unknown>, folderId: string | null = null) => {
|
const importItem = (v: Record<string, unknown>, folderId: string | null = null) => {
|
||||||
if (typeof v.name === 'string' && Array.isArray(v.item)) {
|
if (typeof v.name === 'string' && Array.isArray(v.item)) {
|
||||||
const folder: ExportResources['folders'][0] = {
|
const folder: ExportResources['folders'][0] = {
|
||||||
model: 'folder',
|
model: 'folder',
|
||||||
|
sortPriority: sortPriorityIndex++,
|
||||||
workspaceId: workspace.id,
|
workspaceId: workspace.id,
|
||||||
id: generateId('folder'),
|
id: generateId('folder'),
|
||||||
name: v.name,
|
name: v.name,
|
||||||
@@ -133,7 +135,7 @@ export function convertPostman(contents: string): ImportPluginResponse | undefin
|
|||||||
workspaceId: workspace.id,
|
workspaceId: workspace.id,
|
||||||
folderId,
|
folderId,
|
||||||
name: v.name,
|
name: v.name,
|
||||||
description: v.description ? String(v.description) : undefined,
|
description: r.description ? String(r.description) : undefined,
|
||||||
method: typeof r.method === 'string' ? r.method : 'GET',
|
method: typeof r.method === 'string' ? r.method : 'GET',
|
||||||
url,
|
url,
|
||||||
urlParameters,
|
urlParameters,
|
||||||
@@ -141,6 +143,7 @@ export function convertPostman(contents: string): ImportPluginResponse | undefin
|
|||||||
bodyType: bodyPatch.bodyType,
|
bodyType: bodyPatch.bodyType,
|
||||||
authentication: authPatch.authentication,
|
authentication: authPatch.authentication,
|
||||||
authenticationType: authPatch.authenticationType,
|
authenticationType: authPatch.authenticationType,
|
||||||
|
sortPriority: sortPriorityIndex++,
|
||||||
headers,
|
headers,
|
||||||
};
|
};
|
||||||
exportResources.httpRequests.push(request);
|
exportResources.httpRequests.push(request);
|
||||||
|
|||||||
Reference in New Issue
Block a user