feat: Bulk HTML export (#4620)
* wip * Working bulk html export * Refactor * test * test
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { addDays, differenceInDays } from "date-fns";
|
||||
import { floor } from "lodash";
|
||||
import { action, autorun, computed, observable, set } from "mobx";
|
||||
import { ExportContentType } from "@shared/types";
|
||||
import parseTitle from "@shared/utils/parseTitle";
|
||||
import { isRTL } from "@shared/utils/rtl";
|
||||
import DocumentsStore from "~/stores/DocumentsStore";
|
||||
@@ -419,10 +420,8 @@ export default class Document extends ParanoidModel {
|
||||
};
|
||||
}
|
||||
|
||||
download = async (
|
||||
contentType: "text/html" | "text/markdown" | "application/pdf"
|
||||
) => {
|
||||
await client.post(
|
||||
download = (contentType: ExportContentType) => {
|
||||
return client.post(
|
||||
`/documents.export`,
|
||||
{
|
||||
id: this.id,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { computed } from "mobx";
|
||||
import { FileOperationFormat, FileOperationType } from "@shared/types";
|
||||
import { bytesToHumanReadable } from "@shared/utils/files";
|
||||
import BaseModel from "./BaseModel";
|
||||
import User from "./User";
|
||||
@@ -16,7 +17,9 @@ class FileOperation extends BaseModel {
|
||||
|
||||
size: number;
|
||||
|
||||
type: "import" | "export";
|
||||
type: FileOperationType;
|
||||
|
||||
format: FileOperationFormat;
|
||||
|
||||
user: User;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user