()
| 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) { |
no test coverage detected