Skip to content

Commit

Permalink
HRM
Browse files Browse the repository at this point in the history
  • Loading branch information
valtyr committed Jun 18, 2023
1 parent a34699c commit 40c9f82
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,22 @@ const route = app
const userId = req.param("id");
return subscribe(env.PRODUCER_DO, userId, req.raw);
})
.on(["POST"], "/api/member/update", ({ env, req }) => {
.on(["POST"], "/api/member/update", async ({ env, req }) => {
const userId = "123";

// This factory code could be hidden away in a context creator
const dispatcher = createDispatcherProxy(
rootEventRouter,
env.WORKSPACE_PRODUCER,
workspaceSlug

// This third parameter controls the instance you connect to
// this could be based on user ID, org ID etc.
userId
);

// Dispatch an event
await dispatcher.member.memberUpdated({
memberId: '123',
memberId: "123",
});
});

Expand Down

0 comments on commit 40c9f82

Please sign in to comment.