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">
|
<p className="text-sm text-gray-600 dark:text-gray-400">
|
||||||
{selectedTemplate.description}
|
{selectedTemplate.description}
|
||||||
</p>
|
</p>
|
||||||
{selectedTemplate.uriTemplate
|
{new UriTemplate(selectedTemplate.uriTemplate).variableNames
|
||||||
.match(/{([^}]+)}/g)
|
?.map((key) => {
|
||||||
?.map((param) => {
|
|
||||||
// Remove leading operator characters (?, &, /, #, ;, +, .) from variable name
|
|
||||||
const key = param.slice(1, -1).replace(/^[?&/#;+.]/, "");
|
|
||||||
return (
|
return (
|
||||||
<div key={key}>
|
<div key={key}>
|
||||||
<Label htmlFor={key}>{key}</Label>
|
<Label htmlFor={key}>{key}</Label>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue