Fix cannot delete saml config does not update the list

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
Bryan Frimin
2025-12-24 12:06:19 +01:00
parent 12c7c278ad
commit 7b119b565f
2 changed files with 85 additions and 38 deletions

View File

@@ -12,7 +12,7 @@ import {
Tr, Tr,
useConfirm, useConfirm,
} from "@probo/ui"; } from "@probo/ui";
import { graphql } from "relay-runtime"; import { ConnectionHandler, graphql } from "relay-runtime";
import { useFragment } from "react-relay"; import { useFragment } from "react-relay";
import type { import type {
SAMLConfigurationListFragment$data, SAMLConfigurationListFragment$data,
@@ -46,9 +46,10 @@ const fragment = graphql`
const deleteMutation = graphql` const deleteMutation = graphql`
mutation SAMLConfigurationList_deleteMutation( mutation SAMLConfigurationList_deleteMutation(
$input: DeleteSAMLConfigurationInput! $input: DeleteSAMLConfigurationInput!
$connections: [ID!]!
) { ) {
deleteSAMLConfiguration(input: $input) { deleteSAMLConfiguration(input: $input) {
deletedSamlConfigurationId deletedSamlConfigurationId @deleteEdge(connections: $connections)
} }
} }
`; `;
@@ -91,6 +92,12 @@ export function SAMLConfigurationList(props: {
organizationId, organizationId,
samlConfigurationId: config.id, samlConfigurationId: config.id,
}, },
connections: [
ConnectionHandler.getConnectionID(
organizationId,
"SAMLConfigurationListFragment_samlConfigurations"
),
],
}, },
}); });
}, },

View File

@@ -1,5 +1,5 @@
/** /**
* @generated SignedSource<<4ce15b49974b7e512f334f47765caaa4>> * @generated SignedSource<<6466caf236dccf64aadc80e85172d8e3>>
* @lightSyntaxTransform * @lightSyntaxTransform
* @nogrep * @nogrep
*/ */
@@ -14,6 +14,7 @@ export type DeleteSAMLConfigurationInput = {
samlConfigurationId: string; samlConfigurationId: string;
}; };
export type SAMLConfigurationList_deleteMutation$variables = { export type SAMLConfigurationList_deleteMutation$variables = {
connections: ReadonlyArray<string>;
input: DeleteSAMLConfigurationInput; input: DeleteSAMLConfigurationInput;
}; };
export type SAMLConfigurationList_deleteMutation$data = { export type SAMLConfigurationList_deleteMutation$data = {
@@ -27,55 +28,94 @@ export type SAMLConfigurationList_deleteMutation = {
}; };
const node: ConcreteRequest = (function(){ const node: ConcreteRequest = (function(){
var v0 = [ var v0 = {
"defaultValue": null,
"kind": "LocalArgument",
"name": "connections"
},
v1 = {
"defaultValue": null,
"kind": "LocalArgument",
"name": "input"
},
v2 = [
{ {
"defaultValue": null, "kind": "Variable",
"kind": "LocalArgument", "name": "input",
"name": "input" "variableName": "input"
} }
], ],
v1 = [ v3 = {
{ "alias": null,
"alias": null, "args": null,
"args": [ "kind": "ScalarField",
{ "name": "deletedSamlConfigurationId",
"kind": "Variable", "storageKey": null
"name": "input", };
"variableName": "input"
}
],
"concreteType": "DeleteSAMLConfigurationPayload",
"kind": "LinkedField",
"name": "deleteSAMLConfiguration",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "deletedSamlConfigurationId",
"storageKey": null
}
],
"storageKey": null
}
];
return { return {
"fragment": { "fragment": {
"argumentDefinitions": (v0/*: any*/), "argumentDefinitions": [
(v0/*: any*/),
(v1/*: any*/)
],
"kind": "Fragment", "kind": "Fragment",
"metadata": null, "metadata": null,
"name": "SAMLConfigurationList_deleteMutation", "name": "SAMLConfigurationList_deleteMutation",
"selections": (v1/*: any*/), "selections": [
{
"alias": null,
"args": (v2/*: any*/),
"concreteType": "DeleteSAMLConfigurationPayload",
"kind": "LinkedField",
"name": "deleteSAMLConfiguration",
"plural": false,
"selections": [
(v3/*: any*/)
],
"storageKey": null
}
],
"type": "Mutation", "type": "Mutation",
"abstractKey": null "abstractKey": null
}, },
"kind": "Request", "kind": "Request",
"operation": { "operation": {
"argumentDefinitions": (v0/*: any*/), "argumentDefinitions": [
(v1/*: any*/),
(v0/*: any*/)
],
"kind": "Operation", "kind": "Operation",
"name": "SAMLConfigurationList_deleteMutation", "name": "SAMLConfigurationList_deleteMutation",
"selections": (v1/*: any*/) "selections": [
{
"alias": null,
"args": (v2/*: any*/),
"concreteType": "DeleteSAMLConfigurationPayload",
"kind": "LinkedField",
"name": "deleteSAMLConfiguration",
"plural": false,
"selections": [
(v3/*: any*/),
{
"alias": null,
"args": null,
"filters": null,
"handle": "deleteEdge",
"key": "",
"kind": "ScalarHandle",
"name": "deletedSamlConfigurationId",
"handleArgs": [
{
"kind": "Variable",
"name": "connections",
"variableName": "connections"
}
]
}
],
"storageKey": null
}
]
}, },
"params": { "params": {
"cacheID": "cb46bb31e5d10f0ddad38795a72b1ab1", "cacheID": "cb46bb31e5d10f0ddad38795a72b1ab1",
@@ -88,6 +128,6 @@ return {
}; };
})(); })();
(node as any).hash = "2ebbe76aae843f00570f7ae1848ee995"; (node as any).hash = "aba27afc1e97268478c5159cedf70026";
export default node; export default node;