mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-13 17:22:15 -05:00
Fix error when trying to update server or database properties (#23695)
This commit is contained in:
@@ -124,7 +124,7 @@ async function handleObjectPropertiesDialogCommand(context: azdata.ObjectExplore
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const parentUrn = context.nodeInfo ? await getParentUrn(context) : undefined;
|
||||
const parentUrn = context.isConnectionNode ? undefined : await getParentUrn(context);
|
||||
const objectType = context.nodeInfo ? context.nodeInfo.nodeType as ObjectManagement.NodeType : (context.connectionProfile.databaseName === '' ? ObjectManagement.NodeType.Server : ObjectManagement.NodeType.Database);
|
||||
const objectName = context.nodeInfo ? context.nodeInfo.label : (!context.connectionProfile.databaseName ? context.connectionProfile.serverName : context.connectionProfile.databaseName);
|
||||
const objectUrn = context.nodeInfo ? context.nodeInfo!.metadata!.urn : (context.connectionProfile.databaseName === '' ? 'Server' : `Server/Database[@Name='${escapeSingleQuotes(context.connectionProfile.databaseName)}']`);
|
||||
|
||||
@@ -11,7 +11,7 @@ import * as localizedConstants from './localizedConstants';
|
||||
export async function refreshParentNode(context: azdata.ObjectExplorerContext): Promise<void> {
|
||||
if (context) {
|
||||
try {
|
||||
const node = await azdata.objectexplorer.getNode(context.connectionProfile!.id, context.nodeInfo!.nodePath);
|
||||
const node = await azdata.objectexplorer.getNode(context.connectionProfile!.id, context.nodeInfo?.nodePath);
|
||||
const parentNode = await node?.getParent();
|
||||
await parentNode?.refresh();
|
||||
}
|
||||
@@ -24,7 +24,7 @@ export async function refreshParentNode(context: azdata.ObjectExplorerContext):
|
||||
export async function refreshNode(context: azdata.ObjectExplorerContext): Promise<void> {
|
||||
if (context) {
|
||||
try {
|
||||
const node = await azdata.objectexplorer.getNode(context.connectionProfile!.id, context.nodeInfo!.nodePath);
|
||||
const node = await azdata.objectexplorer.getNode(context.connectionProfile!.id, context.nodeInfo?.nodePath);
|
||||
await node?.refresh();
|
||||
}
|
||||
catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user