@@ -4,6 +4,7 @@ import { useMutationWithToasts } from "../useMutationWithToasts";
|
||||
import type { DocumentGraphDeleteMutation } from "./__generated__/DocumentGraphDeleteMutation.graphql";
|
||||
import type { DocumentGraphSendSigningNotificationsMutation } from "./__generated__/DocumentGraphSendSigningNotificationsMutation.graphql";
|
||||
import type { DocumentGraphDeleteDraftMutation } from "./__generated__/DocumentGraphDeleteDraftMutation.graphql";
|
||||
import type { DocumentGraphBulkExportDocumentsMutation } from "./__generated__/DocumentGraphBulkExportDocumentsMutation.graphql";
|
||||
|
||||
export const documentsQuery = graphql`
|
||||
query DocumentGraphListQuery($organizationId: ID!) {
|
||||
@@ -61,6 +62,28 @@ export function useDeleteDraftDocumentVersionMutation() {
|
||||
);
|
||||
}
|
||||
|
||||
const bulkDeleteDocumentsMutation = graphql`
|
||||
mutation DocumentGraphBulkDeleteDocumentsMutation(
|
||||
$input: BulkDeleteDocumentsInput!
|
||||
) {
|
||||
bulkDeleteDocuments(input: $input) {
|
||||
deletedDocumentIds @deleteRecord
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export function useBulkDeleteDocumentsMutation() {
|
||||
const { __ } = useTranslate();
|
||||
|
||||
return useMutationWithToasts(
|
||||
bulkDeleteDocumentsMutation,
|
||||
{
|
||||
successMessage: __("Documents deleted successfully."),
|
||||
errorMessage: __("Failed to delete documents. Please try again."),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
const sendSigningNotificationsMutation = graphql`
|
||||
mutation DocumentGraphSendSigningNotificationsMutation(
|
||||
$input: SendSigningNotificationsInput!
|
||||
@@ -83,6 +106,28 @@ export function useSendSigningNotificationsMutation() {
|
||||
);
|
||||
}
|
||||
|
||||
const bulkExportDocumentsMutation = graphql`
|
||||
mutation DocumentGraphBulkExportDocumentsMutation(
|
||||
$input: BulkExportDocumentsInput!
|
||||
) {
|
||||
bulkExportDocuments(input: $input) {
|
||||
exportJobId
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export function useBulkExportDocumentsMutation() {
|
||||
const { __ } = useTranslate();
|
||||
|
||||
return useMutationWithToasts<DocumentGraphBulkExportDocumentsMutation>(
|
||||
bulkExportDocumentsMutation,
|
||||
{
|
||||
successMessage: __("Document export started successfully. You will receive an email when the export is ready."),
|
||||
errorMessage: __("Failed to start document export. Please try again."),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
export const documentNodeQuery = graphql`
|
||||
query DocumentGraphNodeQuery($documentId: ID!) {
|
||||
node(id: $documentId) {
|
||||
|
||||
115
apps/console/src/hooks/graph/__generated__/DocumentGraphBulkDeleteDocumentsMutation.graphql.ts
generated
Normal file
115
apps/console/src/hooks/graph/__generated__/DocumentGraphBulkDeleteDocumentsMutation.graphql.ts
generated
Normal file
@@ -0,0 +1,115 @@
|
||||
/**
|
||||
* @generated SignedSource<<a26f31885b4f92b2ad9398bce7f538cf>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @ts-nocheck
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
export type BulkDeleteDocumentsInput = {
|
||||
documentIds: ReadonlyArray<string>;
|
||||
};
|
||||
export type DocumentGraphBulkDeleteDocumentsMutation$variables = {
|
||||
input: BulkDeleteDocumentsInput;
|
||||
};
|
||||
export type DocumentGraphBulkDeleteDocumentsMutation$data = {
|
||||
readonly bulkDeleteDocuments: {
|
||||
readonly deletedDocumentIds: ReadonlyArray<string>;
|
||||
};
|
||||
};
|
||||
export type DocumentGraphBulkDeleteDocumentsMutation = {
|
||||
response: DocumentGraphBulkDeleteDocumentsMutation$data;
|
||||
variables: DocumentGraphBulkDeleteDocumentsMutation$variables;
|
||||
};
|
||||
|
||||
const node: ConcreteRequest = (function(){
|
||||
var v0 = [
|
||||
{
|
||||
"defaultValue": null,
|
||||
"kind": "LocalArgument",
|
||||
"name": "input"
|
||||
}
|
||||
],
|
||||
v1 = [
|
||||
{
|
||||
"kind": "Variable",
|
||||
"name": "input",
|
||||
"variableName": "input"
|
||||
}
|
||||
],
|
||||
v2 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "deletedDocumentIds",
|
||||
"storageKey": null
|
||||
};
|
||||
return {
|
||||
"fragment": {
|
||||
"argumentDefinitions": (v0/*: any*/),
|
||||
"kind": "Fragment",
|
||||
"metadata": null,
|
||||
"name": "DocumentGraphBulkDeleteDocumentsMutation",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v1/*: any*/),
|
||||
"concreteType": "BulkDeleteDocumentsPayload",
|
||||
"kind": "LinkedField",
|
||||
"name": "bulkDeleteDocuments",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v2/*: any*/)
|
||||
],
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"type": "Mutation",
|
||||
"abstractKey": null
|
||||
},
|
||||
"kind": "Request",
|
||||
"operation": {
|
||||
"argumentDefinitions": (v0/*: any*/),
|
||||
"kind": "Operation",
|
||||
"name": "DocumentGraphBulkDeleteDocumentsMutation",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v1/*: any*/),
|
||||
"concreteType": "BulkDeleteDocumentsPayload",
|
||||
"kind": "LinkedField",
|
||||
"name": "bulkDeleteDocuments",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v2/*: any*/),
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"filters": null,
|
||||
"handle": "deleteRecord",
|
||||
"key": "",
|
||||
"kind": "ScalarHandle",
|
||||
"name": "deletedDocumentIds"
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
}
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "655f43d282b8e0007f3b93e381e7ff84",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "DocumentGraphBulkDeleteDocumentsMutation",
|
||||
"operationKind": "mutation",
|
||||
"text": "mutation DocumentGraphBulkDeleteDocumentsMutation(\n $input: BulkDeleteDocumentsInput!\n) {\n bulkDeleteDocuments(input: $input) {\n deletedDocumentIds\n }\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "919857a24f366b8ebe004fcadf503c3d";
|
||||
|
||||
export default node;
|
||||
92
apps/console/src/hooks/graph/__generated__/DocumentGraphBulkExportDocumentsMutation.graphql.ts
generated
Normal file
92
apps/console/src/hooks/graph/__generated__/DocumentGraphBulkExportDocumentsMutation.graphql.ts
generated
Normal file
@@ -0,0 +1,92 @@
|
||||
/**
|
||||
* @generated SignedSource<<a398c636bba3d35aa7caef66c62c9ac6>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @ts-nocheck
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
export type BulkExportDocumentsInput = {
|
||||
documentIds: ReadonlyArray<string>;
|
||||
};
|
||||
export type DocumentGraphBulkExportDocumentsMutation$variables = {
|
||||
input: BulkExportDocumentsInput;
|
||||
};
|
||||
export type DocumentGraphBulkExportDocumentsMutation$data = {
|
||||
readonly bulkExportDocuments: {
|
||||
readonly exportJobId: string;
|
||||
};
|
||||
};
|
||||
export type DocumentGraphBulkExportDocumentsMutation = {
|
||||
response: DocumentGraphBulkExportDocumentsMutation$data;
|
||||
variables: DocumentGraphBulkExportDocumentsMutation$variables;
|
||||
};
|
||||
|
||||
const node: ConcreteRequest = (function(){
|
||||
var v0 = [
|
||||
{
|
||||
"defaultValue": null,
|
||||
"kind": "LocalArgument",
|
||||
"name": "input"
|
||||
}
|
||||
],
|
||||
v1 = [
|
||||
{
|
||||
"alias": null,
|
||||
"args": [
|
||||
{
|
||||
"kind": "Variable",
|
||||
"name": "input",
|
||||
"variableName": "input"
|
||||
}
|
||||
],
|
||||
"concreteType": "BulkExportDocumentsPayload",
|
||||
"kind": "LinkedField",
|
||||
"name": "bulkExportDocuments",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "exportJobId",
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
}
|
||||
];
|
||||
return {
|
||||
"fragment": {
|
||||
"argumentDefinitions": (v0/*: any*/),
|
||||
"kind": "Fragment",
|
||||
"metadata": null,
|
||||
"name": "DocumentGraphBulkExportDocumentsMutation",
|
||||
"selections": (v1/*: any*/),
|
||||
"type": "Mutation",
|
||||
"abstractKey": null
|
||||
},
|
||||
"kind": "Request",
|
||||
"operation": {
|
||||
"argumentDefinitions": (v0/*: any*/),
|
||||
"kind": "Operation",
|
||||
"name": "DocumentGraphBulkExportDocumentsMutation",
|
||||
"selections": (v1/*: any*/)
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "2f4eb206613f8fba307aeee5bad27b93",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "DocumentGraphBulkExportDocumentsMutation",
|
||||
"operationKind": "mutation",
|
||||
"text": "mutation DocumentGraphBulkExportDocumentsMutation(\n $input: BulkExportDocumentsInput!\n) {\n bulkExportDocuments(input: $input) {\n exportJobId\n }\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "0a7bae4b58713bcc824a774c31bd6dca";
|
||||
|
||||
export default node;
|
||||
Reference in New Issue
Block a user