Skip to content

feat: add owner-only company deletion flow#396

Closed
Lp-Francois wants to merge 1 commit into
cursor:mainfrom
Lp-Francois:feat/company-owner-delete
Closed

feat: add owner-only company deletion flow#396
Lp-Francois wants to merge 1 commit into
cursor:mainfrom
Lp-Francois:feat/company-owner-delete

Conversation

@Lp-Francois
Copy link
Copy Markdown

@Lp-Francois Lp-Francois commented May 26, 2026

What

  • add a new authenticated deleteCompanyAction to delete companies only when owner_id matches the current user
  • unlink related MCP listings before deletion by setting mcps.company_id to null
  • add a DeleteCompanyButton with a native browser confirmation popup and success/error toasts
  • show the delete button only for company owners in the company header

Why

Users can accidentally create multiple companies by clicking create several times. This adds a safe owner-managed way to clean up extra company records.

Screenshot 2026-05-26 at 14 15 38

(see https://cursor.directory/companies)

Verification

  • typecheck passes via /opt/homebrew/bin/bun run typecheck in apps/cursor

Note

Medium Risk
Deletes company records and mutates related MCP associations; authorization is owner-scoped but destructive operations warrant careful review.

Overview
Adds an owner-only way to remove a company from the app: a destructive control on the company header (next to edit) that confirms via the browser, then runs a new authenticated server action.

The action loads the company, rejects non-owners, clears company_id on the owner’s related MCP rows (does not delete MCPs), deletes the company row, and revalidates /companies, the company slug route, and /. Success redirects to /companies with a toast; errors surface via toast.

Reviewed by Cursor Bugbot for commit 5e4de20. Bugbot is set up for automated code reviews on this repo. Configure here.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 26, 2026

@Lp-Francois is attempting to deploy a commit to the Anysphere Team on Vercel.

A member of the Team first needs to authorize it.

@Lp-Francois Lp-Francois changed the title Add owner-only company deletion flow feat: add owner-only company deletion flow May 26, 2026
@leerob
Copy link
Copy Markdown
Collaborator

leerob commented May 27, 2026

#400 fixed the duplicate companies here

@leerob leerob closed this May 27, 2026
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.

2 participants