fix: preserve request name when importing cURL commands (#5337)
Co-authored-by: jamesgeorge007 <25279263+jamesgeorge007@users.noreply.github.com>
This commit is contained in:
parent
24c0f9370b
commit
3994d9e9a0
1 changed files with 5 additions and 1 deletions
|
|
@ -149,7 +149,11 @@ const handleImport = () => {
|
|||
|
||||
if (tabs.currentActiveTab.value.document.type === "example-response") return
|
||||
|
||||
tabs.currentActiveTab.value.document.request = req
|
||||
// Preserve the existing request name when importing cURL
|
||||
const currentRequest = tabs.currentActiveTab.value.document.request
|
||||
const reqName = currentRequest?.name ?? req.name
|
||||
|
||||
tabs.currentActiveTab.value.document.request = { ...req, name: reqName }
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
toast.error(`${t("error.curl_invalid_format")}`)
|
||||
|
|
|
|||
Loading…
Reference in a new issue