Skip to content

Commit e3b9a96

Browse files
committed
Update workspace block status in database
Added database updates to set the isBlocked flag and blockedDate when blocking a workspace, and to unset isBlocked when unblocking. This ensures the workspace's block status is accurately reflected in the database.
1 parent bcf145c commit e3b9a96

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

workers/paymaster/src/index.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,15 @@ export default class PaymasterWorker extends Worker {
421421
},
422422
});
423423

424+
await this.workspaces.updateOne({
425+
_id: workspace._id,
426+
}, {
427+
$set: {
428+
isBlocked: true,
429+
blockedDate: workspace.blockedDate || new Date(),
430+
},
431+
});
432+
424433
await this.sendWorkspaceBlockedReport(workspace);
425434
}
426435

@@ -434,6 +443,14 @@ export default class PaymasterWorker extends Worker {
434443
type: 'unblock-workspace',
435444
workspaceId: workspace._id.toString(),
436445
});
446+
447+
await this.workspaces.updateOne({
448+
_id: workspace._id,
449+
}, {
450+
$set: {
451+
isBlocked: false,
452+
},
453+
});
437454
}
438455

439456

0 commit comments

Comments
 (0)