Add trust center configuration
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
28
apps/console/src/hooks/graph/TrustCenterAuditGraph.ts
Normal file
28
apps/console/src/hooks/graph/TrustCenterAuditGraph.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { graphql } from "relay-runtime";
|
||||
import { useMutationWithToasts } from "/hooks/useMutationWithToasts";
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import type { TrustCenterAuditGraphUpdateMutation } from "./__generated__/TrustCenterAuditGraphUpdateMutation.graphql";
|
||||
|
||||
export const trustCenterAuditUpdateMutation = graphql`
|
||||
mutation TrustCenterAuditGraphUpdateMutation($input: UpdateAuditInput!) {
|
||||
updateAudit(input: $input) {
|
||||
audit {
|
||||
id
|
||||
showOnTrustCenter
|
||||
...TrustCenterAuditsCardFragment
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export function useTrustCenterAuditUpdate() {
|
||||
const { __ } = useTranslate();
|
||||
|
||||
return useMutationWithToasts<TrustCenterAuditGraphUpdateMutation>(
|
||||
trustCenterAuditUpdateMutation,
|
||||
{
|
||||
successMessage: __("Audit visibility updated successfully."),
|
||||
errorMessage: __("Failed to update audit visibility. Please try again."),
|
||||
}
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user