mirror of
https://github.com/colanode/colanode.git
synced 2025-12-16 03:37:51 +01:00
Fix message files handling (#210)
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user