Fix audit and framework deletion

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
Sacha Al Himdani
2025-12-09 10:04:47 +01:00
parent c355f1c307
commit 3169fa3c0a
21 changed files with 95 additions and 74 deletions

View File

@@ -112,7 +112,8 @@ export const deleteAuditMutation = graphql`
export const useDeleteAudit = (
audit: { id: string; framework: { name: string } },
connectionId: string
connectionId: string,
onSuccess?: () => void
) => {
const { __ } = useTranslate();
const [mutate] = useMutationWithToasts(deleteAuditMutation, {
@@ -123,15 +124,17 @@ export const useDeleteAudit = (
return () => {
confirm(
() =>
mutate({
async () => {
await mutate({
variables: {
input: {
auditId: audit.id!,
},
connections: [connectionId],
},
}),
});
onSuccess?.();
},
{
message: sprintf(
__(