Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fix(seats): add idempotency guard to toggleProSeat for already-assigned state

Richie McIlroybf8db1cbc9aa
diff --git a/apps/web/actions/organization/toggle-pro-seat.ts b/apps/web/actions/organization/toggle-pro-seat.ts
index 29e52a71c..d3c67709e 100644
--- a/apps/web/actions/organization/toggle-pro-seat.ts
+++ b/apps/web/actions/organization/toggle-pro-seat.ts
@@ -54,6 +54,10 @@ export async function toggleProSeat(
throw new Error("Cannot toggle Pro seat for the organization owner");
}
+ if (member.hasProSeat === enable) {
+ return { success: true };
+ }
+
if (enable) {
const allMembers = await tx
.select({