Skip to content

Normalize group poll path params - #176

Merged
malkoG merged 1 commit into
devfrom
fix/group-avatar-uploading-failure
Apr 22, 2026
Merged

malkoG merged 1 commit into
devfrom
fix/group-avatar-uploading-failure

Conversation

@malkoG

@malkoG malkoG commented Apr 22, 2026 •

Copy link
Copy Markdown
Member

Summary

This PR makes the group poll UI/API route contract consistent by aligning UI and server-router usage to /api/groups/:groupId/polls paths, while keeping backend payload key names (groupActorId) unchanged where needed by controllers.
It also improves guard readability in the group update route and keeps group avatar update behavior unchanged.

Why

  • Avoid path-parameter mismatch errors between route handlers and frontend callers.
    • Frontend and API proxies now use a single :groupId path segment for group-scoped poll endpoints.
  • Keep backend compatibility by preserving existing groupActorId body/query keys expected by controllers.
    • This prevents accidental regressions in poll create/list logic that still expects actor ID fields.

Commit History

  • c85c257: Align group poll route params

Test Plan

  • Run pnpm typecheck and pnpm lint for affected route/controller types.
  • Manually verify PATCH /api/groups/<groupId> and POST /api/groups/<groupId>/avatar from the edit page in a deployed environment (non-dev origin).
  • Manually verify poll create/list calls hit /api/groups/<groupId>/polls and do not 404.

Assisted-By: Codex(gpt-5.4)

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Updated parameter naming in group poll creation and listing endpoints for consistency.
  • Refactor

    • Enhanced error handling code structure in group management endpoints.

Consistent path params were applied to group poll endpoints so they match the rest of the group API (`/groups/:groupId/polls`).
Minor guard-clause formatting was updated in the group patch handler for clarity.

Co-authored-by: Codex <noreply@openai.com>
Assisted-By: Codex(gpt-5.4)
@coderabbitai

coderabbitai Bot commented Apr 22, 2026 •

Copy link
Copy Markdown

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d28adcb7-f2fd-4663-8f72-430fe624bd33

📥 Commits

Reviewing files that changed from the base of the PR and between be1b48f and c85c257.

📒 Files selected for processing (1)
  • src/server-entry.ts

📝 Walkthrough

Walkthrough

Updated /groups/:groupId/polls routes to use groupId URL parameter instead of groupActorId, with associated validation and request forwarding adjustments. Added block braces around early-return error cases in /groups/:groupId PATCH route for consistency.

Changes

Cohort / File(s) Summary
Route Parameter Refactoring
src/server-entry.ts
Renamed URL parameter from groupActorId to groupId in POST and GET /polls routes with corresponding validation logic. Adjusted forwarding calls to /api/groups/${groupId}/polls and inject groupActorId: groupId into request payloads. Added block braces around two existing error-return statements in PATCH route without altering control flow.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A rabbit hops through renamed routes with glee,
Parameter names now shine bright and free,
groupId takes the stage, validation holds tight,
Forwarding flows smoothly—oh, what a delight!
Error braces wrapped up in curly-bracket style! 🎀

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Normalize group poll path params' directly and clearly describes the main change: updating group poll route parameters to use a consistent naming convention (groupId instead of groupActorId).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/group-avatar-uploading-failure

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@malkoG
malkoG merged commit 63d810b into dev Apr 22, 2026
0 of 2 checks passed
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.

1 participant