0
Fork 0
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:
Darcy Ye 2023-11-30 14:21:17 +08:00 committed by GitHub
parent b4f702a860
commit d18dfe5e20
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -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) },
})

View file

@ -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>();