Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve logic for no lemon squeezy customer portal url #270

Merged
merged 1 commit into from
Sep 16, 2024

Conversation

vincanger
Copy link
Collaborator

we had a user confused by the current console.log statement User with ID 123... does not have a LemonSqueezy customer portal URL so I removed the log and added a note to the file. I also changed a bit of the logic.

@@ -39,7 +38,7 @@ export const generateCheckoutSession: GenerateCheckoutSession<PaymentPlanId, Che
};
};

export const getCustomerPortalUrl: GetCustomerPortalUrl<void, string | undefined> = async (_args, context) => {
export const getCustomerPortalUrl: GetCustomerPortalUrl<void, string | null> = async (_args, context) => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed this to null since that's what prisma returns if the user hasn't had a customer portal url assigned to it yet by Lemon Squeezy

@vincanger vincanger merged commit 3fa35b1 into main Sep 16, 2024
1 check passed
@vincanger vincanger deleted the improve-customer-portal-url branch September 16, 2024 10:02
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