-
Notifications
You must be signed in to change notification settings - Fork 3.1k
11311 object create webhook should be triggered when object is created via rest api #11336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
11311 object create webhook should be triggered when object is created via rest api #11336
Conversation
a07b80f
to
26f66f5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
The PR integrates webhook triggers for create, update, and delete operations in the REST API, aligning with GraphQL event handling by standardizing event types to TypeORM's ObjectLiteral.
- Updated type usage in /packages/twenty-server/src/engine/api/graphql/graphql-query-runner/services/api-event-emitter.service.ts to use ObjectLiteral for all event actions.
- Integrated ApiEventEmitterService in /packages/twenty-server/src/engine/api/rest/core/rest-api-core-v2.service.ts to emit webhooks post-create, update, and delete, relying on AuthContext.
- Adjusted /packages/twenty-server/src/engine/api/rest/rest-api.module.ts by removing deprecated dependencies and registering ApiEventEmitterService for webhook support.
3 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile
71897fd
to
2068043
Compare
2068043
to
783fcc3
Compare
await this.getRepositoryAndMetadataOrFail(request); | ||
const createdRecord = await repository.save(body); | ||
|
||
const authContext = this.getAuthContextFromRequest(request); | ||
|
||
if (authContext) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: Shouldn't this be an invariant ? Isn't the route guarded by authentication ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated, workspace was optional but there is no reason for that
Fixes #11311