Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.
TypeScript i18nextnext-authnextjspostgresqlprismareact-emailt3-stacktailwindcsstrpcturborepotypescriptzod
🐛 Fix issue where user cannot be deleted (#2032)
Luke Vella13883b2a05a9
diff --git a/apps/web/src/features/user/ability.ts b/apps/web/src/features/user/ability.tsindex 64c85c23f..81ffc95cd 100644--- a/apps/web/src/features/user/ability.ts+++ b/apps/web/src/features/user/ability.ts@@ -51,9 +51,9 @@ function defineAbilityForUser(// Cannot delete user if they have active subscriptionscannot("delete", "User", {- spaces: {+ subscriptions: {some: {- tier: "pro",+ active: true,},},});diff --git a/apps/web/src/features/user/actions.ts b/apps/web/src/features/user/actions.tsindex 71e6714dc..dc45fdc26 100644--- a/apps/web/src/features/user/actions.ts+++ b/apps/web/src/features/user/actions.ts@@ -64,9 +64,9 @@ export const deleteUserAction = adminActionClientconst user = await prisma.user.findUnique({where: { id: userId },include: {- spaces: {+ subscriptions: {select: {- tier: true,+ active: true,},},},