mirror of
https://github.com/logto-io/logto.git
synced 2025-01-06 20:40:08 -05:00
fix(console): should not display unsaved changes alert on connector config updated (#1685)
This commit is contained in:
parent
61177ca2a1
commit
61b65a7288
1 changed files with 4 additions and 2 deletions
|
@ -30,6 +30,7 @@ const ConnectorContent = ({ isDeleted, connectorData, onConnectorUpdated }: Prop
|
|||
formState: { isSubmitting, isDirty },
|
||||
handleSubmit,
|
||||
watch,
|
||||
reset,
|
||||
} = methods;
|
||||
|
||||
const defaultConfig = useMemo(() => {
|
||||
|
@ -53,11 +54,12 @@ const ConnectorContent = ({ isDeleted, connectorData, onConnectorUpdated }: Prop
|
|||
return;
|
||||
}
|
||||
|
||||
const { metadata, ...reset } = await api
|
||||
const { metadata, ...rest } = await api
|
||||
.patch(`/api/connectors/${connectorData.id}`, { json: { config: result.data } })
|
||||
.json<Connector & { metadata: ConnectorMetadata }>();
|
||||
|
||||
onConnectorUpdated({ ...reset, ...metadata });
|
||||
onConnectorUpdated({ ...rest, ...metadata });
|
||||
reset({ configJson: JSON.stringify(result.data, null, 2) });
|
||||
toast.success(t('general.saved'));
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue