The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
Update use-payment-methods.ts
Steven Tey93b5d37569ea
diff --git a/apps/web/lib/swr/use-payment-methods.ts b/apps/web/lib/swr/use-payment-methods.tsindex 9890cf9ffb..838aa4cade 100644--- a/apps/web/lib/swr/use-payment-methods.ts+++ b/apps/web/lib/swr/use-payment-methods.ts@@ -7,14 +7,18 @@ import useWorkspace from "./use-workspace";export default function usePaymentMethods() {const { slug } = useWorkspace();- const { data, isLoading, error } = useSWR<Stripe.PaymentMethod[]>(+ const {+ data: paymentMethods,+ isLoading,+ error,+ } = useSWR<Stripe.PaymentMethod[]>(slug && `/api/workspaces/${slug}/billing/payment-methods`,fetcher,);return {- paymentMethods: data || [],+ paymentMethods,error,- loading: isLoading && !error && !data,+ loading: isLoading,};}