feat: pass event type#24098
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🧪 Early access (Sonnet 4.5): enabledWe are currently testing the Sonnet 4.5 model, which is expected to improve code review quality. However, this model may lead to increased noise levels in the review comments. Please disable the early access features if the noise level causes any inconvenience. Note:
Comment |
| const eventType = await this.prismaClient.eventType.findFirst({ | ||
| where: { | ||
| id: eventTypeId, | ||
| userId, | ||
| }, |
There was a problem hiding this comment.
if data is not required, it's better to use a count instead of findFirst.
const count = await this.prismaClient.eventType.count({
where: { id: eventTypeId, userId },
})
return count > 0
joeauyeung
left a comment
There was a problem hiding this comment.
We should also address @volnei's comment as well
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
| return workflow.activeOn.map((active) => active.eventTypeId); | ||
| } | ||
|
|
||
| static async getEventTypeIdsByWorkflowStepId({ workflowStepId }: { workflowStepId: number }) { |
There was a problem hiding this comment.
todo: refactor these to not use static method after inbound call PR has been merged
There was a problem hiding this comment.
@Udit-takkar we can introduce a new method even keeping the existing ones to avoid breaking changes and use the instance of this class. What do you think? This is similar on what I did here #24190
What does this PR do?
Completes #24093
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?