chore: port fix to selfhost-desktop
This commit is contained in:
committed by
Andrew Bastin
parent
8844d52f5f
commit
ce9ea0cbc7
@@ -112,10 +112,15 @@ function exportedCollectionToHoppCollection(
|
||||
folders: restCollection.folders.map((folder) =>
|
||||
exportedCollectionToHoppCollection(folder, collectionType)
|
||||
),
|
||||
requests: restCollection.requests.map(
|
||||
({
|
||||
id,
|
||||
requests: restCollection.requests.map((request) => {
|
||||
const requestParsedResult = HoppRESTRequest.safeParse(request)
|
||||
if (requestParsedResult.type === "ok") {
|
||||
return requestParsedResult.value
|
||||
}
|
||||
|
||||
const {
|
||||
v,
|
||||
id,
|
||||
auth,
|
||||
body,
|
||||
endpoint,
|
||||
@@ -125,20 +130,23 @@ function exportedCollectionToHoppCollection(
|
||||
params,
|
||||
preRequestScript,
|
||||
testScript,
|
||||
}) => ({
|
||||
id,
|
||||
requestVariables,
|
||||
} = request
|
||||
return {
|
||||
v,
|
||||
auth,
|
||||
body,
|
||||
endpoint,
|
||||
headers,
|
||||
method,
|
||||
id,
|
||||
name,
|
||||
endpoint,
|
||||
method,
|
||||
params,
|
||||
requestVariables: requestVariables,
|
||||
auth,
|
||||
headers,
|
||||
body,
|
||||
preRequestScript,
|
||||
testScript,
|
||||
})
|
||||
),
|
||||
}
|
||||
}),
|
||||
}
|
||||
} else {
|
||||
const gqlCollection = collection as ExportedUserCollectionGQL
|
||||
|
||||
@@ -124,35 +124,35 @@ function exportedCollectionToHoppCollection(
|
||||
const requestParsedResult = HoppRESTRequest.safeParse(request)
|
||||
if (requestParsedResult.type === "ok") {
|
||||
return requestParsedResult.value
|
||||
} else {
|
||||
const {
|
||||
v,
|
||||
id,
|
||||
auth,
|
||||
body,
|
||||
endpoint,
|
||||
headers,
|
||||
method,
|
||||
name,
|
||||
params,
|
||||
preRequestScript,
|
||||
testScript,
|
||||
requestVariables,
|
||||
} = request
|
||||
return {
|
||||
v,
|
||||
id,
|
||||
name,
|
||||
endpoint,
|
||||
method,
|
||||
params,
|
||||
requestVariables: requestVariables,
|
||||
auth,
|
||||
headers,
|
||||
body,
|
||||
preRequestScript,
|
||||
testScript,
|
||||
}
|
||||
}
|
||||
|
||||
const {
|
||||
v,
|
||||
id,
|
||||
auth,
|
||||
body,
|
||||
endpoint,
|
||||
headers,
|
||||
method,
|
||||
name,
|
||||
params,
|
||||
preRequestScript,
|
||||
testScript,
|
||||
requestVariables,
|
||||
} = request
|
||||
return {
|
||||
v,
|
||||
id,
|
||||
name,
|
||||
endpoint,
|
||||
method,
|
||||
params,
|
||||
requestVariables: requestVariables,
|
||||
auth,
|
||||
headers,
|
||||
body,
|
||||
preRequestScript,
|
||||
testScript,
|
||||
}
|
||||
}),
|
||||
auth: data.auth,
|
||||
|
||||
Reference in New Issue
Block a user