Skip to content

[V4] Add endpoint for editing comments - #14523

Open
mattsoh wants to merge 2 commits into
hackclub:mainfrom
mattsoh:mattsoh-api-comments-edit
Open

[V4] Add endpoint for editing comments#14523
mattsoh wants to merge 2 commits into
hackclub:mainfrom
mattsoh:mattsoh-api-comments-edit

Conversation

@mattsoh

@mattsoh mattsoh commented Aug 6, 2026

Copy link
Copy Markdown
Member

Summary of the problem

Add ability to edit comments on V4 Api. This helps for Steelyard, and maybe HCB mobile?

Describe your changes

Added endpoint (content and admin_only).

@mattsoh
mattsoh requested review from a team and Copilot August 6, 2026 18:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

def update
@comment = authorize Comment.find_by_public_id!(params[:id])

@comment.update!(params.permit(:content, :admin_only))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you please write tests for this?

  • When admin_only is omitted, it doesn't change admin_only in the DB
    • make sure to the case where it start as admin_only = true
  • When admin_only is a non-boolean (e.g. string or integer), what do we do?

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