From 73cb21d9de75c3945331ea4a9181de603fb843a2 Mon Sep 17 00:00:00 2001 From: Josh Creek <8179928+jcreek@users.noreply.github.com> Date: Tue, 8 Oct 2024 20:34:25 +0100 Subject: [PATCH] fix(#32): Strongly type the recurring string enum --- src/routes/products/[productId]/+server.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/products/[productId]/+server.ts b/src/routes/products/[productId]/+server.ts index bde4ae6..c1b83c8 100644 --- a/src/routes/products/[productId]/+server.ts +++ b/src/routes/products/[productId]/+server.ts @@ -8,7 +8,7 @@ export const GET = async ({ params }) => { 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; return json(product); };