Fix block delete handler for record content update mutation

This commit is contained in:
Hakan Shehu
2025-01-20 13:00:51 +01:00
parent 1d9df2fa5c
commit 5b0ff0275e

View File

@@ -18,7 +18,6 @@ export class RecordContentUpdateMutationHandler
input: RecordContentUpdateMutationInput
): Promise<RecordContentUpdateMutationOutput> {
const workspace = this.getWorkspace(input.accountId, input.workspaceId);
const result = await workspace.entries.updateEntry<RecordAttributes>(
input.recordId,
(attributes) => {
@@ -53,7 +52,11 @@ export class RecordContentUpdateMutationHandler
}
for (const beforeBlock of beforeBlocks) {
if (!content[beforeBlock.id]) {
const afterBlock = afterBlocks.find(
(block) => block.id === beforeBlock.id
);
if (!afterBlock) {
delete content[beforeBlock.id];
}
}