972: Replace unnecessary data query#1010
Conversation
The entities themselves weren't used.
WalkthroughThis pull request introduces a new utility function, Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant DTM as DatasetTask Middleware
participant CM as Common Middleware (fetchEntityCount)
participant DB as Database
Client->>DTM: Send request with org info
DTM->>CM: Call fetchEntityCount
CM->>DB: Execute SQL query (SELECT COUNT(*))
DB-->>CM: Return entityCount
CM-->>DTM: Return fetched entityCount
DTM->>DTM: Use req.entityCount.count in prepareTasks
DTM->>Client: Process and respond to request
Assessment against linked issues
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (1)
🧰 Additional context used🧬 Code Definitions (1)src/middleware/common.middleware.js (4)
🔇 Additional comments (7)
✨ Finishing Touches
🪧 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 (
|
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||
What type of PR is this? (check all applicable)
Description
Whole set of entities was fetched when only the count was needed.
Related Tickets & Documents
QA Instructions, Screenshots, Recordings
Added/updated tests?
QA sign off
Summary by CodeRabbit
New Features
Optimisations
Tests