mirror of
https://github.com/colanode/colanode.git
synced 2025-12-28 16:06:37 +01:00
Fix foreign key constraint error in node delete
This commit is contained in:
@@ -43,6 +43,11 @@ export class NodeDeleteMutationHandler
|
||||
const isFile = node.type === NodeTypes.File;
|
||||
|
||||
await workspaceDatabase.transaction().execute(async (trx) => {
|
||||
await trx
|
||||
.deleteFrom('user_nodes')
|
||||
.where('node_id', '=', input.nodeId)
|
||||
.execute();
|
||||
|
||||
await trx.deleteFrom('nodes').where('id', '=', input.nodeId).execute();
|
||||
|
||||
if (isFile) {
|
||||
|
||||
Reference in New Issue
Block a user