mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -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;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
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 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 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)}']`);
|
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> {
|
export async function refreshParentNode(context: azdata.ObjectExplorerContext): Promise<void> {
|
||||||
if (context) {
|
if (context) {
|
||||||
try {
|
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();
|
const parentNode = await node?.getParent();
|
||||||
await parentNode?.refresh();
|
await parentNode?.refresh();
|
||||||
}
|
}
|
||||||
@@ -24,7 +24,7 @@ export async function refreshParentNode(context: azdata.ObjectExplorerContext):
|
|||||||
export async function refreshNode(context: azdata.ObjectExplorerContext): Promise<void> {
|
export async function refreshNode(context: azdata.ObjectExplorerContext): Promise<void> {
|
||||||
if (context) {
|
if (context) {
|
||||||
try {
|
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();
|
await node?.refresh();
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
|||||||
Reference in New Issue
Block a user