use UriTemplate variable names
This commit is contained in:
parent
2f50a4ba0e
commit
f1650d06e3
1 changed files with 2 additions and 5 deletions
|
|
@ -238,11 +238,8 @@ const ResourcesTab = ({
|
|||
<p className="text-sm text-gray-600 dark:text-gray-400">
|
||||
{selectedTemplate.description}
|
||||
</p>
|
||||
{selectedTemplate.uriTemplate
|
||||
.match(/{([^}]+)}/g)
|
||||
?.map((param) => {
|
||||
// Remove leading operator characters (?, &, /, #, ;, +, .) from variable name
|
||||
const key = param.slice(1, -1).replace(/^[?&/#;+.]/, "");
|
||||
{new UriTemplate(selectedTemplate.uriTemplate).variableNames
|
||||
?.map((key) => {
|
||||
return (
|
||||
<div key={key}>
|
||||
<Label htmlFor={key}>{key}</Label>
|
||||
|
|
|
|||
Loading…
Reference in a new issue