feat: input toggle for parameters and headers (#1388)
* feat: toggler for parameters and headers * refactor: move bodyParams to separate component + feat: input toggle * fix: backward copaitability * Fixed issue with imported active prop mutations Co-authored-by: Andrew Bastin <andrewbastin.k@gmail.com>
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
export function hasPathParams(params) {
|
||||
return params.some(({ type }) => type === "path")
|
||||
return params
|
||||
.filter((item) => (item.hasOwnProperty("active") ? item.active == true : true))
|
||||
.some(({ type }) => type === "path")
|
||||
}
|
||||
|
||||
export function addPathParamsToVariables(params, variables) {
|
||||
params
|
||||
.filter((item) => (item.hasOwnProperty("active") ? item.active == true : true))
|
||||
.filter(({ key }) => !!key)
|
||||
.filter(({ type }) => type === "path")
|
||||
.forEach(({ key, value }) => (variables[key] = value))
|
||||
@@ -11,5 +14,8 @@ export function addPathParamsToVariables(params, variables) {
|
||||
}
|
||||
|
||||
export function getQueryParams(params) {
|
||||
return params.filter(({ key }) => !!key).filter(({ type }) => type != "path")
|
||||
return params
|
||||
.filter((item) => (item.hasOwnProperty("active") ? item.active == true : true))
|
||||
.filter(({ key }) => !!key)
|
||||
.filter(({ type }) => type != "path")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user