File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -77,14 +77,19 @@ const setActive = (target: HTMLElement | null) => {
7777}
7878
7979const handleMore = (command : string ) => {
80+ console .log (' handleMore called with command:' , command )
8081 let element = document .getElementById (" selected-api-version" )
8182 if (element !== null ) {
8283 element .textContent = command ;
8384 }
8485 if (command .includes (' _' )) {
86+ console .log (' Navigating to message docs:' , command )
8587 router .push ({ name: ' message-docs' , params: { id: command } })
8688 } else {
87- router .replace ({ path: ` /resource-docs/${command } ` })
89+ console .log (' Navigating to resource docs:' , ` /resource-docs/${command } ` )
90+ console .log (' Current route:' , route .path )
91+ // Clear operationid query param when changing versions to avoid showing non-existent operation
92+ router .replace ({ path: ` /resource-docs/${command } ` , query: {} })
8893 }
8994}
9095
Original file line number Diff line number Diff line change @@ -74,6 +74,13 @@ const roleForm = reactive({})
7474
7575const setOperationDetails = (id : string , version : string ): void => {
7676 const operation = getOperationDetails (version , id , resourceDocs )
77+
78+ // Safety check: if operation doesn't exist (e.g., after version change), return early
79+ if (! operation ) {
80+ console .warn (` Operation "${id }" not found in version "${version }" ` )
81+ return
82+ }
83+
7784 // Replace the version in the URL with the current viewing version
7885 // This ensures users test against the version they're viewing (e.g., v6.0.0)
7986 // even if the endpoint was originally defined in an earlier version (e.g., v3.1.0)
You can’t perform that action at this time.
0 commit comments