perf: Contact optimisation fixes (#12016)

- Avoids the duplicate count queries for contact end point

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
This commit is contained in:
Tanmay Deep Sharma
2025-09-25 15:29:55 +02:00
committed by GitHub
parent cd2c58726f
commit 59f7c8aa55
2 changed files with 11 additions and 10 deletions

View File

@@ -5,6 +5,6 @@ end
json.payload do
json.array! @contacts do |contact|
json.partial! 'api/v1/models/contact', formats: [:json], resource: contact, with_contact_inboxes: true
json.partial! 'api/v1/models/contact', formats: [:json], resource: contact, with_contact_inboxes: @include_contact_inboxes
end
end