Skip to content

Commit

Permalink
feat: delete Redis key once no longer needed
Browse files Browse the repository at this point in the history
  • Loading branch information
rayokamoto committed Feb 17, 2024
1 parent 632daab commit 34815d9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/app/(account)/settings/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ const verifyMembershipPayment = async (clerkId: string) => {
.update(memberTable)
.set({ membershipExpiresAt: expiryDate })
.where(eq(memberTable.id, clerkId));

// Delete key from Redis since it is no longer needed
await redisClient.del(`payment:membership:${clerkId}`);

return { paid: true as const, membershipExpiresAt: expiryDate };
};
export type MembershipPayment = Awaited<ReturnType<typeof verifyMembershipPayment>>;
Expand Down

0 comments on commit 34815d9

Please sign in to comment.