Use @deleteRecord on SCIM disconnect mutation
The custom updater on the SCIM disconnect mutation ran on every response and nulled organization.scimConfiguration in the Relay store -- including on error responses, which flipped the UI to the "disconnected" state even when the backend had actually rejected the delete. Replace the updater with a @deleteRecord directive on the returned deletedScimConfigurationId, matching the pattern already used in SCIMConfiguration.tsx. @deleteRecord is a no-op when the returned id is null, so error responses no longer produce a false-positive UI update. Signed-off-by: Aurélien Sibiril <81782+aureliensibiril@users.noreply.github.com>
This commit is contained in:
committed by
Sacha Al Himdani
parent
f15936dcdf
commit
7143944fba
@@ -54,7 +54,7 @@ const deleteSCIMConfigurationMutation = graphql`
|
||||
$input: DeleteSCIMConfigurationInput!
|
||||
) {
|
||||
deleteSCIMConfiguration(input: $input) {
|
||||
deletedScimConfigurationId
|
||||
deletedScimConfigurationId @deleteRecord
|
||||
}
|
||||
}
|
||||
`;
|
||||
@@ -147,12 +147,6 @@ export function GoogleWorkspaceConnector(props: {
|
||||
variant: "error",
|
||||
});
|
||||
},
|
||||
updater: (store) => {
|
||||
const organizationRecord = store.get(organizationId);
|
||||
if (organizationRecord) {
|
||||
organizationRecord.setValue(null, "scimConfiguration");
|
||||
}
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user