mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-05 08:07:05 +00:00
Merge 51cce99399 into 49affa7c01
This commit is contained in:
commit
c1963e7b2d
2 changed files with 6 additions and 1 deletions
|
|
@ -25,6 +25,11 @@ describe("createTabRoutes.slugFromPathname", () => {
|
|||
it("returns empty string when the base segment is not in the path", () => {
|
||||
expect(routes.slugFromPathname("/teams")).toBe("");
|
||||
});
|
||||
|
||||
it("reads the route base after a server-root prefix that repeats the segment name", () => {
|
||||
expect(routes.slugFromPathname("/logs/ui/logs/audit/")).toBe("audit");
|
||||
expect(routes.slugFromPathname("/logs/ui/logs/")).toBe("");
|
||||
});
|
||||
});
|
||||
|
||||
describe("createTabRoutes.tabHref", () => {
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ export function createTabRoutes<Slug extends string>(baseSegment: string, slugs:
|
|||
|
||||
const slugFromPathname = (pathname: string): string => {
|
||||
const parts = pathname.split("/").filter(Boolean);
|
||||
const idx = parts.indexOf(baseSegment);
|
||||
const idx = parts.lastIndexOf(baseSegment);
|
||||
if (idx === -1) {
|
||||
return "";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue