Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions src/hops/HopsFunctionMgr.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,18 @@ public static void SeekFunctionMenuDirs(UriFunctionPathInfo path, string uri, st
if (endpoints[1].Contains("/"))
{
var subendpoints = endpoints[1].Split(new[] { '/' }, 2);
UriFunctionPathInfo functionPath = new UriFunctionPathInfo("/" + subendpoints[0], true);
functionPath.RootURL = row.SourcePath;
path.Paths.Add(functionPath);
string endpointKey = "/" + subendpoints[0];

// Check if this endpoint already exists to avoid duplicate menu entries
UriFunctionPathInfo functionPath = path.Paths.Find(p => p.EndPoint == endpointKey);
if (functionPath == null)
{
// Create new path only if it doesn't exist
functionPath = new UriFunctionPathInfo(endpointKey, true);
functionPath.RootURL = row.SourcePath;
path.Paths.Add(functionPath);
}

SeekFunctionMenuDirs(functionPath, "/" + subendpoints[1], fullpath, row);
}
else
Expand Down