diff --git a/functions/requestParams.js b/functions/requestParams.js new file mode 100644 index 000000000..80ea19821 --- /dev/null +++ b/functions/requestParams.js @@ -0,0 +1,17 @@ +export function hasPathParams(params) { + return params.some((p) => p.type === "path") +} + +export function addPathParamsToVariables(params, variables) { + params + .filter(({ key }) => !!key) + .filter(({ type }) => type === "path") + .forEach(p => variables[p.key] = p.value) + return variables; +} + +export function getQueryParams(params) { + return params + .filter(({ key }) => !!key) + .filter(({ type }) => type != "path") +} \ No newline at end of file diff --git a/pages/index.vue b/pages/index.vue index a523eae4e..c94dd2210 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -848,6 +848,22 @@ " /> +
  • + + + +