@@ -37,26 +37,26 @@ import { NavRoutes } from "@/components/nav-route.tsx";
3737import { Button } from "@/components/ui/button.tsx" ;
3838import { HttpApiDefinition } from "@/types/golemManifest.ts" ;
3939
40- const MenuItems = ( id : string , apiName : string , version : string ) => [
40+ const MenuItems = ( appId : string , apiName : string , version : string ) => [
4141 {
4242 title : "Overview" ,
43- url : `/app/${ id } /apis/${ apiName } /version/${ version } ` ,
43+ url : `/app/${ appId } /apis/${ apiName } /version/${ version } ` ,
4444 icon : Home ,
4545 } ,
4646 {
4747 title : "Settings" ,
48- url : `/app/${ id } /apis/${ apiName } /version/${ version } /settings` ,
48+ url : `/app/${ appId } /apis/${ apiName } /version/${ version } /settings` ,
4949 icon : Settings ,
5050 } ,
5151 {
5252 title : "New Version" ,
53- url : `/app/${ id } /apis/${ apiName } /version/${ version } /newversion` ,
53+ url : `/app/${ appId } /apis/${ apiName } /version/${ version } /newversion` ,
5454 icon : CircleFadingPlusIcon ,
5555 } ,
5656] ;
5757
5858export const ApiLayout = ( ) => {
59- const { apiName, version, id } = useParams ( ) ;
59+ const { apiName, version, appId } = useParams ( ) ;
6060 const [ queryParams ] = useSearchParams ( ) ;
6161 const navigate = useNavigate ( ) ;
6262 const [ apiDetails , setApiDetails ] = useState < HttpApiDefinition > ( ) ;
@@ -81,7 +81,7 @@ export const ApiLayout = () => {
8181 } , [ apiDetails ] ) ;
8282
8383 useEffect ( ( ) => {
84- API . getApi ( id ! , apiName ! ) . then ( async response => {
84+ API . getApi ( appId ! , apiName ! ) . then ( async response => {
8585 let detail = response . find ( r => r . version == version ) ;
8686 setApiDetails ( detail ) ;
8787 if ( response ) {
@@ -98,15 +98,15 @@ export const ApiLayout = () => {
9898 } , [ apiName , version , path , method , reload ] ) ;
9999
100100 const handleNavigateHome = useCallback ( ( ) => {
101- navigate ( `/app/${ id } /apis/${ apiName } /version/${ version } ` ) ;
101+ navigate ( `/app/${ appId } /apis/${ apiName } /version/${ version } ` ) ;
102102 setCurrentMenu ( "Overview" ) ;
103103 } , [ navigate , apiName , version ] ) ;
104104
105105 return (
106106 < ErrorBoundary >
107107 < SidebarProvider >
108108 < SidebarMenu
109- menus = { MenuItems ( id ! , apiName ! , version ! ) }
109+ menus = { MenuItems ( appId ! , apiName ! , version ! ) }
110110 activeItem = { currentMenu }
111111 setActiveItem = { setCurrentMenu }
112112 title = { "Worker" }
@@ -117,7 +117,7 @@ export const ApiLayout = () => {
117117 return {
118118 method : route . method ,
119119 name : route . path ,
120- url : `/app/${ id } /apis/${ apiName } /version/${ version } /routes/?path=${ route . path } &method=${ route . method } ` ,
120+ url : `/app/${ appId } /apis/${ apiName } /version/${ version } /routes/?path=${ route . path } &method=${ route . method } ` ,
121121 } ;
122122 } ) }
123123 setActiveItem = { value => setCurrentMenu ( value ) }
@@ -156,7 +156,7 @@ export const ApiLayout = () => {
156156 ) ;
157157 if ( selectedApi ) {
158158 navigate (
159- `/app/${ id } /apis/${ apiName } /version/${ version } ${ basePath } ` ,
159+ `/app/${ appId } /apis/${ apiName } /version/${ version } ${ basePath } ` ,
160160 ) ;
161161 }
162162 } }
@@ -200,7 +200,7 @@ export const ApiLayout = () => {
200200 variant = "default"
201201 onClick = { ( ) => {
202202 navigate (
203- `/app/${ id } /apis/${ apiName } /version/${ version } /routes/add?` ,
203+ `/app/${ appId } /apis/${ apiName } /version/${ version } /routes/add?` ,
204204 ) ;
205205 setCurrentMenu ( "Add New Route" ) ;
206206 } }
0 commit comments