mirror of
https://github.com/docmost/docmost.git
synced 2025-11-12 14:22:36 +10:00
feat: editor file attachments (#194)
* fix current slider value * WIP * changes to extension attributes * update command title
This commit is contained in:
@ -27,6 +27,7 @@ import {
|
||||
TiptapImage,
|
||||
TiptapVideo,
|
||||
TrailingNode,
|
||||
Attachment,
|
||||
} from '@docmost/editor-ext';
|
||||
import { generateText, JSONContent } from '@tiptap/core';
|
||||
import { generateHTML } from '../common/helpers/prosemirror/html';
|
||||
@ -65,6 +66,7 @@ export const tiptapExtensions = [
|
||||
TiptapImage,
|
||||
TiptapVideo,
|
||||
Callout,
|
||||
Attachment,
|
||||
CustomCodeBlock
|
||||
] as any;
|
||||
|
||||
|
||||
@ -16,4 +16,4 @@ export const InlineFileExtensions = [
|
||||
'.mp4',
|
||||
'.mov',
|
||||
];
|
||||
export const MAX_FILE_SIZE = '20MB';
|
||||
export const MAX_FILE_SIZE = '50MB';
|
||||
|
||||
@ -123,6 +123,11 @@ export class AttachmentController {
|
||||
|
||||
return res.send(fileResponse);
|
||||
} catch (err: any) {
|
||||
if (err?.statusCode === 413) {
|
||||
const errMessage = `File too large. Exceeds the ${MAX_FILE_SIZE} limit`;
|
||||
this.logger.error(errMessage);
|
||||
throw new BadRequestException(errMessage);
|
||||
}
|
||||
this.logger.error(err);
|
||||
throw new BadRequestException('Error processing file upload.');
|
||||
}
|
||||
|
||||
@ -38,7 +38,6 @@ export async function prepareFile(
|
||||
mimeType: file.mimetype,
|
||||
};
|
||||
} catch (error) {
|
||||
console.error('Error in file preparation:', error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user