-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
fix: link email to org on creation #1357
Conversation
WalkthroughThe recent changes improve the functionality of the Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
#1053 Bundle Size — 3.5MiB (~-0.01%).Warning Bundle contains 5 duplicate packages – View duplicate packages Bundle metrics
|
Current #1053 |
Baseline #1049 |
|
---|---|---|
Initial JS | 3.07MiB (~-0.01% ) |
3.07MiB |
Initial CSS | 9.54KiB |
9.54KiB |
Cache Invalidation | 35.09% |
53.99% |
Chunks | 64 |
64 |
Assets | 77 |
77 |
Modules | 2056 |
2056 |
Duplicate Modules | 340 |
340 |
Duplicate Code | 9.43% |
9.43% |
Packages | 209 |
209 |
Duplicate Packages | 5 |
5 |
Bundle size by type 1 change
1 improvement
Current #1053 |
Baseline #1049 |
|
---|---|---|
JS | 3.39MiB (~-0.01% ) |
3.39MiB |
Fonts | 94.54KiB |
94.54KiB |
CSS | 9.54KiB |
9.54KiB |
Other | 9.1KiB |
9.1KiB |
IMG | 8.57KiB |
8.57KiB |
Bundle analysis report Branch JoeKarow/fix-new-email Project dashboard
📦 Next.js Bundle Analysis for @weareinreach/appThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- packages/api/router/orgEmail/mutation.update.handler.ts (1 hunks)
- packages/ui/components/data-portal/EmailDrawer/index.tsx (1 hunks)
Additional comments not posted (2)
packages/api/router/orgEmail/mutation.update.handler.ts (1)
54-62
: Ensure proper handling oflinkLocationId
andorgId
.The conditional logic correctly handles the presence of
linkLocationId
and creates eitherlocations
ororganization
fields. However, ensure thatlinkLocationId
andorgId
are always valid and sanitized before use.Verification successful
Validation for
linkLocationId
andorgId
is present.The
linkLocationId
andorgId
variables are validated usingzod
schemas, ensuring they are strings and can be nullish. This validation is consistently applied in the codebase.
packages/api/router/orgEmail/mutation.update.handler.ts
: Validation logic usingzod
schemas.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that `linkLocationId` and `orgId` are always valid and sanitized before use. # Test: Search for the function usage and check for validation or sanitization logic. Expect: Validations or sanitizations before use. rg --type python -A 5 $'linkLocationId' rg --type python -A 5 $'orgId'Length of output: 130
Script:
#!/bin/bash # Description: Verify that `linkLocationId` and `orgId` are always valid and sanitized before use. # Test: Search for the function usage and check for validation or sanitization logic. Expect: Validations or sanitizations before use. rg --type typescript -A 5 'linkLocationId' rg --type typescript -A 5 'orgId'Length of output: 146
Script:
#!/bin/bash # Description: Verify that `linkLocationId` and `orgId` are always valid and sanitized before use. # Test: Search for the function usage and check for validation or sanitization logic. Expect: Validations or sanitizations before use. rg -A 5 'linkLocationId' rg -A 5 'orgId'Length of output: 110410
packages/ui/components/data-portal/EmailDrawer/index.tsx (1)
107-108
: Refactor improves clarity and reduces redundancy.The refactor to use an
onSuccess
callback improves the logical flow and reduces redundancy. Ensure that theinvalidate
call does not introduce any unintended side effects.
Quality Gate passedIssues Measures |
Pull Request type
Please check the type of change your PR introduces:
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this introduce a breaking change?
Other information
Summary by CodeRabbit
New Features
update
functionality to conditionally create eitherlocations
ororganization
entries based on the presence oflinkLocationId
.Refactor
EmailDrawer
component to improve the logical flow by using a singleonSuccess
callback for state updates and notifications.