Skip to content

Fix People resource to use correct V2 API /api/v2/signups endpoints#6

Merged
ebrett merged 1 commit intomainfrom
feature/nb-agv-people-api-resources
Dec 8, 2025
Merged

Fix People resource to use correct V2 API /api/v2/signups endpoints#6
ebrett merged 1 commit intomainfrom
feature/nb-agv-people-api-resources

Conversation

@ebrett
Copy link
Owner

@ebrett ebrett commented Dec 8, 2025

Summary

Fixes the People resource to use the correct NationBuilder V2 API endpoints. The V2 API uses /api/v2/signups instead of /api/v2/people.

Changes

  • Updated lib/nationbuilder_api/resources/people.rb:

    • Changed endpoint from /api/v2/people/:id to /api/v2/signups/:id
    • Added support for /api/v2/signups/me for current user
    • Updated documentation to reflect correct resource type (signup instead of person)
  • Updated spec/nationbuilder_api/resources/people_spec.rb:

    • All test expectations now use /api/v2/signups endpoints
    • Changed expected resource type from person to signup
    • Added test for /api/v2/signups/me endpoint
    • All 19 tests passing ✅

Motivation

The gem was calling /api/v2/people/:id which doesn't exist in the NationBuilder V2 API. The correct endpoint is /api/v2/signups/:id as documented in the OpenAPI spec.

This was causing 404 errors when trying to fetch user profile data in production.

Test plan

  • All existing tests pass
  • Added test for /api/v2/signups/me endpoint
  • Verified endpoints match OpenAPI spec
  • Integration test with actual NationBuilder API (requires testing in consuming app)

🤖 Generated with Claude Code

The NationBuilder V2 API uses /api/v2/signups, not /api/v2/people.
Updated all People resource endpoints to use the correct path:
- show() now calls /api/v2/signups/:id
- Added support for /api/v2/signups/me for current user
- Updated tests to reflect correct endpoint and resource type (signup vs person)
- All 19 tests passing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@ebrett ebrett merged commit 17b9ae7 into main Dec 8, 2025
3 checks passed
@ebrett ebrett deleted the feature/nb-agv-people-api-resources branch December 10, 2025 05:52
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