feat(admin): allow setting owner when creating an account #140

Merged
chihlasm merged 2 commits from feat/admin-account-owner-on-create into main 2026-04-14 21:27:02 +00:00
chihlasm commented 2026-04-14 14:30:35 +00:00 (Migrated from github.com)

Summary

Adds an optional Owner Email field to the Create Account modal in the admin panel. Previously there was no way to assign an owner when creating an account — you had to create it, then separately find the user and link them.

Changes:

  • AdminAccountCreate schema gains owner_email?: string (optional)
  • Backend looks up the user by email, 404s with a clear message if not found, sets owner_id on the new account
  • Frontend modal form adds the Owner Email field with helper text
  • Error handling improved: backend 404 detail ("No user found with email '...'") now surfaces in the toast instead of the generic "Failed to create account"

Pre-Landing Review

No issues found.

Test plan

  • TypeScript compiles clean (npx tsc -b)
  • Create account without owner email — works as before
  • Create account with valid owner email — owner set correctly
  • Create account with unknown email — toast shows "No user found with email '...'"

🤖 Generated with Claude Code

## Summary Adds an optional **Owner Email** field to the Create Account modal in the admin panel. Previously there was no way to assign an owner when creating an account — you had to create it, then separately find the user and link them. **Changes:** - `AdminAccountCreate` schema gains `owner_email?: string` (optional) - Backend looks up the user by email, 404s with a clear message if not found, sets `owner_id` on the new account - Frontend modal form adds the Owner Email field with helper text - Error handling improved: backend 404 detail ("No user found with email '...'") now surfaces in the toast instead of the generic "Failed to create account" ## Pre-Landing Review No issues found. ## Test plan - [x] TypeScript compiles clean (`npx tsc -b`) - [ ] Create account without owner email — works as before - [ ] Create account with valid owner email — owner set correctly - [ ] Create account with unknown email — toast shows "No user found with email '...'" 🤖 Generated with [Claude Code](https://claude.com/claude-code)
railway-app[bot] commented 2026-04-14 14:30:49 +00:00 (Migrated from github.com)

🚅 Deployed to the resolutionflow-pr-140 environment in selfless-grace

Service Status Web Updated (UTC)
patherly Success (View Logs) Web Apr 14, 2026 at 9:25 pm
hopeful-liberation Success (View Logs) Web Apr 14, 2026 at 9:25 pm
<!-- railway-bot-comment-version=2 --> <!-- railway-project-id="22b9b58c-271b-42e5-a10e-6fdec8d00134" railway-project-name="selfless-grace" --> 🚅 Deployed to the [resolutionflow-pr-140](https://railway.com/project/22b9b58c-271b-42e5-a10e-6fdec8d00134?environmentId=c119465e-7754-49d4-b0a4-27d5ff875060) environment in **[selfless-grace](https://railway.com/project/22b9b58c-271b-42e5-a10e-6fdec8d00134)** | **Service** | **Status** | **Web** | **Updated** (UTC) | | :--- | :--- | :--- | :--- | | patherly | ✅ Success ([View Logs](https://railway.com/project/22b9b58c-271b-42e5-a10e-6fdec8d00134/service/95f556ff-5264-4116-a0c2-618a2fc53ba4?id=3fd7c1ba-a4ef-4451-b606-c9d62fdf40f3&environmentId=c119465e-7754-49d4-b0a4-27d5ff875060)) | [Web](https://patherly-resolutionflow-pr-140.up.railway.app) | Apr 14, 2026 at 9:25 pm | | hopeful-liberation | ✅ Success ([View Logs](https://railway.com/project/22b9b58c-271b-42e5-a10e-6fdec8d00134/service/e1db2ee3-d241-4f45-abe4-c9c5fdf483d5?id=1c8ede62-b3c2-4050-9427-9a16d7e5d6ed&environmentId=c119465e-7754-49d4-b0a4-27d5ff875060)) | [Web](https://hopeful-liberation-resolutionflow-pr-140.up.railway.app) | Apr 14, 2026 at 9:25 pm |
Sign in to join this conversation.