-
Notifications
You must be signed in to change notification settings - Fork 1
OUT-2917: public api to list comments of a task #1088
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
base: feature/api-improvements
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- [x] public api route that gets list of comments for a task - [x] taskId required validation - [x] accept params: taskId, parentCommentId, createdBy - [x] include attachment in reponse with presigned download url
185a100 to
08e8f4c
Compare
3c523ed to
bcc44f7
Compare
bcc44f7 to
fb80e8e
Compare
| uploadedByUserType, | ||
| uploadedDate: RFC3339DateSchema.parse(toRFC3339(attachment.createdAt)), | ||
| })) | ||
| return await Promise.all(promises) |
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.
Is there a chance that we will hit supabase api per sec ratelimits if there are 50+ attachments?
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.
Used supabase storage's createSignedUrls() to resolve this.
| return await this.db.comment.findMany({ | ||
| where, | ||
| ...pagination, | ||
| include: { attachments: true }, | ||
| orderBy: { createdAt: 'desc' }, | ||
| }) | ||
| } |
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.
Is the comments table properly indexed here, can you please check
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.
created composite index with taskId, workspaceId, createdAt DESC.
Changes
Testing Criteria
Loom