-
-
Notifications
You must be signed in to change notification settings - Fork 104
fix(rest): multiple relation id filter values are not properly split #2085
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
Conversation
📝 WalkthroughWalkthroughThe changes update the REST API handler's filter construction logic to support filtering to-one relation fields by multiple IDs. When a filter value for such a field contains multiple comma-separated IDs, the logic now constructs an OR filter with individual ID conditions for each value. Previously, only a single value was supported and multiple values were ignored. A new test case has been added to verify that filtering by a relation field with multiple values returns the expected results. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant REST_API_Handler
participant Prisma
Client->>REST_API_Handler: GET /post?filter[author]=user1,user2
REST_API_Handler->>REST_API_Handler: Parse filter values
REST_API_Handler->>REST_API_Handler: Construct OR filter for author IDs
REST_API_Handler->>Prisma: Query posts with OR filter on author
Prisma-->>REST_API_Handler: Return matching posts
REST_API_Handler-->>Client: Respond with filtered posts
Assessment against linked issues
Possibly related PRs
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
⏰ Context from checks skipped due to timeout of 90000ms (5)
🔇 Additional comments (2)
✨ Finishing Touches
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. 🪧 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 using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
fixes #2061