mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-11-08 15:04:29 +00:00
fix: correct behavior for displayName when add and remove (#18989)
Co-authored-by: Shailesh Parmar <shailesh.parmar.webdev@gmail.com>
This commit is contained in:
parent
8c148adc38
commit
46d2d2ad89
@ -197,13 +197,12 @@ export const DatabaseSchemaTable = ({
|
|||||||
displayName: data.displayName || undefined,
|
displayName: data.displayName || undefined,
|
||||||
};
|
};
|
||||||
const jsonPatch = compare(schemaDetails, updatedData);
|
const jsonPatch = compare(schemaDetails, updatedData);
|
||||||
await patchDatabaseSchemaDetails(schemaDetails.id ?? '', jsonPatch);
|
const response = await patchDatabaseSchemaDetails(
|
||||||
|
schemaDetails.id ?? '',
|
||||||
|
jsonPatch
|
||||||
|
);
|
||||||
setSchemas((prevData) =>
|
setSchemas((prevData) =>
|
||||||
prevData.map((schema) =>
|
prevData.map((schema) => (schema.id === id ? response : schema))
|
||||||
schema.id === id
|
|
||||||
? { ...schema, displayName: data.displayName }
|
|
||||||
: schema
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
showErrorToast(error as AxiosError);
|
showErrorToast(error as AxiosError);
|
||||||
|
|||||||
@ -98,14 +98,10 @@ function SchemaTablesTab({
|
|||||||
displayName: data.displayName || undefined,
|
displayName: data.displayName || undefined,
|
||||||
};
|
};
|
||||||
const jsonPatch = compare(tableDetails, updatedData);
|
const jsonPatch = compare(tableDetails, updatedData);
|
||||||
await patchTableDetails(tableDetails.id, jsonPatch);
|
const response = await patchTableDetails(tableDetails.id, jsonPatch);
|
||||||
|
|
||||||
setLocalTableData((prevData) =>
|
setLocalTableData((prevData) =>
|
||||||
prevData.map((table) =>
|
prevData.map((table) => (table.id === id ? response : table))
|
||||||
table.id === id
|
|
||||||
? { ...table, displayName: data.displayName }
|
|
||||||
: table
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
showErrorToast(error as AxiosError);
|
showErrorToast(error as AxiosError);
|
||||||
|
|||||||
@ -156,17 +156,13 @@ function ServiceMainTabContent({
|
|||||||
displayName: entityData.displayName || undefined,
|
displayName: entityData.displayName || undefined,
|
||||||
};
|
};
|
||||||
const jsonPatch = compare(pageDataDetails, updatedData);
|
const jsonPatch = compare(pageDataDetails, updatedData);
|
||||||
await callServicePatchAPI(
|
const response = await callServicePatchAPI(
|
||||||
serviceCategory,
|
serviceCategory,
|
||||||
pageDataDetails.id,
|
pageDataDetails.id,
|
||||||
jsonPatch
|
jsonPatch
|
||||||
);
|
);
|
||||||
setPageData((prevData) =>
|
setPageData((prevData) =>
|
||||||
prevData.map((data) =>
|
prevData.map((data) => (data.id === id && response ? response : data))
|
||||||
data.id === id
|
|
||||||
? { ...data, displayName: entityData.displayName }
|
|
||||||
: data
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
showErrorToast(error as AxiosError);
|
showErrorToast(error as AxiosError);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user