MCPcopy Create free account
hub / github.com/WardAnalytics/WardGraph / getSubscription

Function getSubscription

src/services/stripe/subscriptions.tsx:46–60  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

44 }
45
46 const getSubscription = async () => {
47 const queryRef = query(collection(db, "products"), where("active", "==", true));
48 const collectionSnap = await getDocs(queryRef);
49
50 for (const doc of collectionSnap.docs) {
51 const subscriptionObj = doc.data() as Subscription;
52 subscriptionObj.id = doc.id;
53
54 const subscription = await getSubscriptionPrice(subscriptionObj);
55
56 return subscription;
57 }
58
59 return null;
60 }
61
62 useEffect(() => {
63 if (enabled) {

Callers 1

useActiveSubscriptionFunction · 0.85

Calls 1

getSubscriptionPriceFunction · 0.85

Tested by

no test coverage detected