Fix message files handling (#210)

This commit is contained in:
Hakan Shehu
2025-09-11 11:22:40 +02:00
committed by GitHub
parent 692a0dbe87
commit 49ee759e93
2 changed files with 4 additions and 23 deletions

View File

@@ -36,7 +36,7 @@ export class MessageCreateMutationHandler
// check if there are nested nodes (files, pages, folders etc.)
for (const block of Object.values(blocks)) {
if (block.type === EditorNodeTypes.TempFile) {
const tempFileId = block.attrs?.id;
const tempFileId = block.id;
if (!tempFileId) {
throw new MutationError(
MutationErrorCode.FileInvalid,

View File

@@ -24,27 +24,6 @@ export const TempFileNode = Node.create({
id: {
default: null,
},
name: {
default: null,
},
path: {
default: null,
},
size: {
default: null,
},
type: {
default: null,
},
mimeType: {
default: null,
},
extension: {
default: null,
},
url: {
default: null,
},
};
},
renderHTML({ HTMLAttributes }) {
@@ -66,7 +45,9 @@ export const TempFileNode = Node.create({
.focus()
.insertContentAt(pos, {
type: 'tempFile',
attrs: file,
attrs: {
id: file.id,
},
})
.run();