mirror of
https://github.com/logto-io/logto.git
synced 2025-03-24 22:41:28 -05:00
fix(console): fix accidental removal of empty object/undefined values (#4993)
This commit is contained in:
parent
b4f702a860
commit
d18dfe5e20
2 changed files with 6 additions and 1 deletions
|
@ -62,6 +62,7 @@ function Connection<T extends SsoProviderName>({ isDeleted, data, onUpdated }: P
|
|||
}
|
||||
|
||||
const updatedSsoConnector = await api
|
||||
// TODO: @darcyYe add console test case to remove attribute mapping config.
|
||||
.patch(`api/sso-connectors/${ssoConnectorId}`, {
|
||||
json: { config: cleanDeep(formData) },
|
||||
})
|
||||
|
|
|
@ -111,9 +111,13 @@ function Experience({ data, isDeleted, onUpdated }: Props) {
|
|||
|
||||
try {
|
||||
const updatedSsoConnector = await api
|
||||
// TODO: @darcyYe add console test case of clean up `branding` config.
|
||||
// Only keep non-empty values since PATCH operation performs a merge scheme.
|
||||
.patch(`api/sso-connectors/${data.id}`, {
|
||||
json: cleanDeep(formDataToSsoConnectorParser(formData)),
|
||||
json: cleanDeep(formDataToSsoConnectorParser(formData), {
|
||||
// To overwrite the `branding` field, which is a JSONB typed column in DB.
|
||||
emptyObjects: false,
|
||||
}),
|
||||
})
|
||||
.json<SsoConnectorWithProviderConfig>();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue