diff --git a/web/pgadmin/tools/sqleditor/static/js/show_query_tool.js b/web/pgadmin/tools/sqleditor/static/js/show_query_tool.js index 1406a36b0e6..412c89adc88 100644 --- a/web/pgadmin/tools/sqleditor/static/js/show_query_tool.js +++ b/web/pgadmin/tools/sqleditor/static/js/show_query_tool.js @@ -32,7 +32,7 @@ export function generateUrl(trans_id, parentData, sqlId) { if(parentData.database.label) { url_endpoint += `&database_name=${parentData.database.label}`; } - if(parentData.server.user.name){ + if(parentData.server.user?.name){ url_endpoint += `&user=${parentData.server.user.name}`; } } diff --git a/web/pgadmin/tools/sqleditor/static/js/show_view_data.js b/web/pgadmin/tools/sqleditor/static/js/show_view_data.js index e3b3bf61219..2f944b2e8ce 100644 --- a/web/pgadmin/tools/sqleditor/static/js/show_view_data.js +++ b/web/pgadmin/tools/sqleditor/static/js/show_view_data.js @@ -134,9 +134,12 @@ function generateUrl(trans_id, connectionData, nodeData, parentData) { +`&sgid=${parentData.server_group._id}` +`&sid=${parentData.server._id}` +`&did=${parentData.database._id}` - +`&user=${parentData.server.user.name}` +`&server_type=${parentData.server.server_type}`; + if(parentData.server.user?.name){ + url_endpoint += `&user=${parentData.server.user.name}`; + } + return url_endpoint; }