fix(admin): make the Memberships surface editable with grant/revoke #158
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/BUNYIP-118-membership-edit-route"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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