-
Notifications
You must be signed in to change notification settings - Fork 58
feat: add pagination for inbound email attachments #670
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
feat: add pagination for inbound email attachments #670
Conversation
commit: |
5b258d6 to
2afef7b
Compare
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.
1 issue found across 4 files
Prompt for AI agents (all 1 issues)
Understand the root cause of the following 1 issues and fix them.
<file name="src/attachments/receiving/receiving.ts">
<violation number="1" location="src/attachments/receiving/receiving.ts:34">
The list call now targets `/emails/receiving/:emailId`, but it needs the `/attachments` suffix; otherwise it fetches the email resource instead of its attachments, breaking the response shape.</violation>
</file>
React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.
2afef7b to
9654979
Compare
9654979 to
fb5096e
Compare
| async get(options: GetAttachmentOptions): Promise<GetAttachmentResponse> { | ||
| const { emailId, id } = options; | ||
|
|
||
| const data = await this.resend.get<GetAttachmentResponseSuccess>( |
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.
Why is it calling an API and not the DB here?
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.
Not sure I understand this comment. This is the get method that we call on resend.emails.receiving.get so it can't connect to a DB? Maybe I'm missing something? 🤔
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.
For reference, the existing get method for the outbound emails does the same call but to the outbound route:
async get(id: string): Promise<GetEmailResponse> {
const data = await this.resend.get<GetEmailResponseSuccess>(
`/emails/${id}`,
);
return data;
}
This PR is the SDK complement to https://github.com/resend/resend-api/pull/2192. It adds pagination to the inbound email attachments.
I also used this opportunity to:
objecttolistfor the method that lists attachment (I did that on the API PR too)/emails/receiving/:emailId/attachmentsalias from the API instead of the old/emails/inbound/:emailId/attachmentsSummary by cubic
Added pagination for inbound email attachments in the SDK and switched to the new /emails/receiving endpoints. Aligns with PRODUCT-710 to enable cursor-based navigation and reduce large payloads.
New Features
Migration