store events into a collection

This commit is contained in:
2025-07-23 09:54:02 +05:30
parent 089c034dd6
commit 05abf66d66
7 changed files with 86 additions and 1 deletions

View File

@@ -21,6 +21,7 @@ export async function createOrg(input: CreateOrgInput, tenantId: string) {
dbEvents.emit(
"change",
{
tenantId: tenantId,
type: "insert",
collection: "orgs",
document: org,
@@ -99,6 +100,7 @@ export async function updateOrg(
dbEvents.emit(
"change",
{
tenantId: tenantId,
type: "update",
collection: "orgs",
document: updateOrgResult,
@@ -119,6 +121,7 @@ export async function deleteOrg(orgId: string, tenantId: string) {
dbEvents.emit(
"change",
{
tenantId: tenantId,
type: "delete",
collection: "orgs",
document: {