Skip to content

Conversation

@hellenlluo
Copy link

References

Proposed Changes

  • Implemented commentService.ts

@linear
Copy link

linear bot commented Nov 23, 2025

@vercel
Copy link

vercel bot commented Nov 23, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
help Ready Ready Preview, Comment Dec 17, 2025 11:57pm

export async function createNewComment(): Promise<Comment | null> {
// POST answers/{answerId}/comments/
return null;
export async function getAllComments(answerId: string | number): Promise<Comment[] | null> {
Copy link
Contributor

Choose a reason for hiding this comment

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

We can treat answerId as a string

}

export async function updateCommentDetails(commentId: string): Promise<Comment | null> {
type UpdateCommentPayload = Partial<Pick<Comment, 'text' | 'is_anonymous' | 'hearts'>>;
Copy link
Contributor

Choose a reason for hiding this comment

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

We can just make the payload a type with all the fields for a comment for now

export async function getAllComments(): Promise<Comment[] | null> {
// GET answers/{answerId}/comments/
return null;
async function parseComment(res: Response): Promise<Comment | null> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if these parsing functions are needed since they are pretty self explanatory and might make more sense within the functions. We also don't need the check for 204 since that's for empty response, which should only happen for delete

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants