first commit
This commit is contained in:
3
src/jobs/index.ts
Normal file
3
src/jobs/index.ts
Normal file
@ -0,0 +1,3 @@
|
||||
// export all your job files here
|
||||
|
||||
export * from "./setupUser";
|
16
src/jobs/setupUser.ts
Normal file
16
src/jobs/setupUser.ts
Normal file
@ -0,0 +1,16 @@
|
||||
import { triggerClient } from "@/trigger";
|
||||
import { eventTrigger } from "@trigger.dev/sdk";
|
||||
|
||||
triggerClient.defineJob({
|
||||
id: "setup-user",
|
||||
name: "Setup User: Add first time user to the database",
|
||||
version: "0.0.1",
|
||||
trigger: eventTrigger({
|
||||
name: "user.add",
|
||||
}),
|
||||
run: async (payload, io, ctx) => {
|
||||
const { id } = payload;
|
||||
|
||||
await io.logger.info(`Setup User: Running for ${id}`);
|
||||
},
|
||||
});
|
Reference in New Issue
Block a user