use UriTemplate variable names

This commit is contained in:
dr3s 2025-06-03 13:58:33 -04:00
commit f1650d06e3

View file

@ -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>