Check STRIPE_PRIVATE_KEY exists before stripe call during disband (#2454)
parent
66aeadffbb
commit
5e3da4d178
|
@ -149,7 +149,9 @@ export const viewerTeamsRouter = createProtectedRouter()
|
|||
async resolve({ ctx, input }) {
|
||||
if (!(await isTeamOwner(ctx.user?.id, input.teamId))) throw new TRPCError({ code: "UNAUTHORIZED" });
|
||||
|
||||
await downgradeTeamMembers(input.teamId);
|
||||
if (process.env.STRIPE_PRIVATE_KEY) {
|
||||
await downgradeTeamMembers(input.teamId);
|
||||
}
|
||||
|
||||
// delete all memberships
|
||||
await ctx.prisma.membership.deleteMany({
|
||||
|
|
Loading…
Reference in New Issue