mirror of
https://github.com/jcreek/SvelteKitSaasBoilerplate.git
synced 2026-07-13 02:53:50 +00:00
fix(#32): Strongly type the recurring string enum
This commit is contained in:
@@ -8,7 +8,7 @@ export const GET = async ({ params }) => {
|
|||||||
|
|
||||||
const price = await stripeClient.prices.retrieve(product.default_price);
|
const price = await stripeClient.prices.retrieve(product.default_price);
|
||||||
|
|
||||||
const isSubscription = (price.type as Stripe.Price.type) === 'recurring';
|
const isSubscription = price.type === ('recurring' as Stripe.Price.type);
|
||||||
product.isSubscription = isSubscription;
|
product.isSubscription = isSubscription;
|
||||||
return json(product);
|
return json(product);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user