Refactor compliance page documents page
Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
@@ -1,49 +0,0 @@
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import { graphql } from "relay-runtime";
|
||||
|
||||
import type { TrustCenterDocumentGraphUpdateMutation } from "#/__generated__/core/TrustCenterDocumentGraphUpdateMutation.graphql";
|
||||
import { useMutationWithToasts } from "#/hooks/useMutationWithToasts";
|
||||
|
||||
export const trustCenterDocumentsQuery = graphql`
|
||||
query TrustCenterDocumentGraphQuery($organizationId: ID!) {
|
||||
organization: node(id: $organizationId) {
|
||||
... on Organization {
|
||||
id
|
||||
documents(first: 100) {
|
||||
edges {
|
||||
node {
|
||||
id
|
||||
...TrustCenterDocumentsCardFragment
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const updateDocumentVisibilityMutation = graphql`
|
||||
mutation TrustCenterDocumentGraphUpdateMutation(
|
||||
$input: UpdateDocumentInput!
|
||||
) {
|
||||
updateDocument(input: $input) {
|
||||
document {
|
||||
id
|
||||
trustCenterVisibility
|
||||
...TrustCenterDocumentsCardFragment
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export function useUpdateDocumentVisibilityMutation() {
|
||||
const { __ } = useTranslate();
|
||||
|
||||
return useMutationWithToasts<TrustCenterDocumentGraphUpdateMutation>(
|
||||
updateDocumentVisibilityMutation,
|
||||
{
|
||||
successMessage: __("Document visibility updated successfully."),
|
||||
errorMessage: __("Failed to update document visibility"),
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -32,14 +32,6 @@ export const trustCenterQuery = graphql`
|
||||
)
|
||||
canCreateAccess: permission(action: "core:trust-center-access:create")
|
||||
}
|
||||
documents(first: 100) {
|
||||
edges {
|
||||
node {
|
||||
id
|
||||
...TrustCenterDocumentsCardFragment
|
||||
}
|
||||
}
|
||||
}
|
||||
vendors(first: 100) {
|
||||
edges {
|
||||
node {
|
||||
@@ -58,17 +50,6 @@ export const trustCenterQuery = graphql`
|
||||
}
|
||||
}
|
||||
}
|
||||
slackConnections(first: 100) {
|
||||
edges {
|
||||
node {
|
||||
id
|
||||
channel
|
||||
channelId
|
||||
createdAt
|
||||
updatedAt
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user