diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Database/DatabaseSchema/DatabaseSchemaTable/DatabaseSchemaTable.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Database/DatabaseSchema/DatabaseSchemaTable/DatabaseSchemaTable.tsx index 64148e9108e..51fb5c1e3e5 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Database/DatabaseSchema/DatabaseSchemaTable/DatabaseSchemaTable.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Database/DatabaseSchema/DatabaseSchemaTable/DatabaseSchemaTable.tsx @@ -197,13 +197,12 @@ export const DatabaseSchemaTable = ({ displayName: data.displayName || undefined, }; const jsonPatch = compare(schemaDetails, updatedData); - await patchDatabaseSchemaDetails(schemaDetails.id ?? '', jsonPatch); + const response = await patchDatabaseSchemaDetails( + schemaDetails.id ?? '', + jsonPatch + ); setSchemas((prevData) => - prevData.map((schema) => - schema.id === id - ? { ...schema, displayName: data.displayName } - : schema - ) + prevData.map((schema) => (schema.id === id ? response : schema)) ); } catch (error) { showErrorToast(error as AxiosError); diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/DatabaseSchemaPage/SchemaTablesTab.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/DatabaseSchemaPage/SchemaTablesTab.tsx index cc397a63a3d..b1c6f8c7ae6 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/DatabaseSchemaPage/SchemaTablesTab.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/DatabaseSchemaPage/SchemaTablesTab.tsx @@ -98,14 +98,10 @@ function SchemaTablesTab({ displayName: data.displayName || undefined, }; const jsonPatch = compare(tableDetails, updatedData); - await patchTableDetails(tableDetails.id, jsonPatch); + const response = await patchTableDetails(tableDetails.id, jsonPatch); setLocalTableData((prevData) => - prevData.map((table) => - table.id === id - ? { ...table, displayName: data.displayName } - : table - ) + prevData.map((table) => (table.id === id ? response : table)) ); } catch (error) { showErrorToast(error as AxiosError); diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/ServiceDetailsPage/ServiceMainTabContent.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/ServiceDetailsPage/ServiceMainTabContent.tsx index bf9643b01fe..bc8ec9e475b 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/ServiceDetailsPage/ServiceMainTabContent.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/ServiceDetailsPage/ServiceMainTabContent.tsx @@ -156,17 +156,13 @@ function ServiceMainTabContent({ displayName: entityData.displayName || undefined, }; const jsonPatch = compare(pageDataDetails, updatedData); - await callServicePatchAPI( + const response = await callServicePatchAPI( serviceCategory, pageDataDetails.id, jsonPatch ); setPageData((prevData) => - prevData.map((data) => - data.id === id - ? { ...data, displayName: entityData.displayName } - : data - ) + prevData.map((data) => (data.id === id && response ? response : data)) ); } catch (error) { showErrorToast(error as AxiosError);