Skip to content

fix(emails): flatten metrics filter query params - #1052

Merged
dielduarte merged 1 commit into
preview-headless-dashboardfrom
flatten-emails-metrics-filter-params
Aug 7, 2026
Merged

fix(emails): flatten metrics filter query params#1052
dielduarte merged 1 commit into
preview-headless-dashboardfrom
flatten-emails-metrics-filter-params

Conversation

@dielduarte

@dielduarte dielduarte commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • The public-api's /emails/metrics endpoint now accepts domain_id/email_id as flat query params instead of filter[domain_id]/filter[email_id] (resend/resend-monorepo#7974).
  • Updates buildMetricsQuery in src/emails/emails.ts to send the flat params. The public SDK option shape (filter: { domainId, emailId }) is unchanged — only the wire format sent to the API changed.

Test plan

  • Updated emails.spec.ts expected request URLs to the flat param format
  • vitest run src/emails/emails.spec.ts — 33 passing
  • biome check — clean

Summary by cubic

Flattened /emails/metrics query params to use domain_id and email_id instead of filter[domain_id] and filter[email_id], matching the public API contract. Updated buildMetricsQuery to send the flat params; the SDK option shape (filter: { domainId, emailId }) remains unchanged.

Written for commit 2c23260. Summary will update on new commits.

Review in cubic

domain_id/email_id are now sent as flat query params instead of
filter[domain_id]/filter[email_id], matching the public-api's updated
contract. The public filter.domainId/filter.emailId option shape is
unchanged.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@dielduarte
dielduarte marked this pull request as ready for review August 6, 2026 21:34
@dielduarte
dielduarte requested a review from a team as a code owner August 6, 2026 21:34
@dielduarte
dielduarte requested review from vcapretz and removed request for a team August 6, 2026 21:34

@klotty klotty left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Auto-approved: Focused fix aligning SDK wire format with the updated /emails/metrics API; the public SDK option shape is unchanged and tests pin the new flat params. No product, security, or operational tradeoff remains for human review.

Re-trigger cubic

@github-actions github-actions Bot added the linear-synced PR has been synced to Linear label Aug 7, 2026
@dielduarte
dielduarte merged commit bdf2204 into preview-headless-dashboard Aug 7, 2026
4 checks passed
@dielduarte
dielduarte deleted the flatten-emails-metrics-filter-params branch August 7, 2026 14:20
gabrielmfern pushed a commit that referenced this pull request Aug 7, 2026
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
gabrielmfern pushed a commit that referenced this pull request Aug 7, 2026
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

linear-synced PR has been synced to Linear

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants