fix(admin): make the Memberships surface editable with grant/revoke #158

Merged
David merged 2 commits from fix/BUNYIP-118-membership-edit-route into main 2026-06-17 12:47:19 +02:00
Owner

The admin Memberships page rendered user_email, tier and status read-only: it surfaced no subscription_override_by, offered no edit affordance, and bunyip-web had no POST route to adjust a membership. The bunyip-api already exposes POST /admin/memberships/grant and /revoke (admin-override free membership that sets/clears subscription_override_by), so this wires the existing surface to those endpoints rather than adding a new backend path.

Add grant_membership/revoke_membership to the bunyip-web admin API client, register POST /admin/memberships/:user_id/{grant,revoke} routes, and add the membership_grant/membership_revoke handlers (admin-guarded, redirect back to the listing). The listing now shows an "Admin override" badge when subscription_override_by is set, a per-row View link to the user-detail page, and a Grant/Revoke action (Revoke shown when an override is active, Grant otherwise), each behind a confirm prompt to match the other admin mutations.

#BUNYIP-118

The admin Memberships page rendered user_email, tier and status read-only: it surfaced no subscription_override_by, offered no edit affordance, and bunyip-web had no POST route to adjust a membership. The bunyip-api already exposes POST /admin/memberships/grant and /revoke (admin-override free membership that sets/clears subscription_override_by), so this wires the existing surface to those endpoints rather than adding a new backend path. Add grant_membership/revoke_membership to the bunyip-web admin API client, register POST /admin/memberships/:user_id/{grant,revoke} routes, and add the membership_grant/membership_revoke handlers (admin-guarded, redirect back to the listing). The listing now shows an "Admin override" badge when subscription_override_by is set, a per-row View link to the user-detail page, and a Grant/Revoke action (Revoke shown when an override is active, Grant otherwise), each behind a confirm prompt to match the other admin mutations. #BUNYIP-118
fix(admin): make the Memberships surface editable with grant/revoke
All checks were successful
Check / fmt / clippy / build / test (pull_request) Successful in 1m49s
276f0094c8
The admin Memberships page rendered user_email, tier and status read-only: it surfaced no subscription_override_by, offered no edit affordance, and bunyip-web had no POST route to adjust a membership. The bunyip-api already exposes POST /admin/memberships/grant and /revoke (admin-override free membership that sets/clears subscription_override_by), so this wires the existing surface to those endpoints rather than adding a new backend path.

Add grant_membership/revoke_membership to the bunyip-web admin API client, register POST /admin/memberships/:user_id/{grant,revoke} routes, and add the membership_grant/membership_revoke handlers (admin-guarded, redirect back to the listing). The listing now shows an "Admin override" badge when subscription_override_by is set, a per-row View link to the user-detail page, and a Grant/Revoke action (Revoke shown when an override is active, Grant otherwise), each behind a confirm prompt to match the other admin mutations.

#BUNYIP-118
Merge branch 'main' into fix/BUNYIP-118-membership-edit-route
Some checks failed
Create release / Create release from merged PR (pull_request) Has been skipped
Check / fmt / clippy / build / test (pull_request) Failing after 10s
53d641f079
David merged commit 023caa3c91 into main 2026-06-17 12:47:19 +02:00
David deleted branch fix/BUNYIP-118-membership-edit-route 2026-06-17 12:47:20 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/bunyip!158
No description provided.