Refactor referral code handling by removing unnecessary console logs and improving error handling in the referral code fetching process. Update test script to include referral tests and adjust product item validation logic for better clarity and functionality.

This commit is contained in:
John Yeo
2025-04-18 13:49:05 +01:00
parent fa80aa8f73
commit 1893c16049
35 changed files with 284 additions and 431 deletions

View File

@@ -23,7 +23,6 @@ export const redeemReferralCode = async ({
customerId,
code: referralCode,
});
console.log("Referral code redeemed");
console.log("Redemption", redemption);
return redemption;
};

View File

@@ -17,7 +17,6 @@ const useReferralCode = (referrerId: string) => {
const { code } = await getReferralCode(referrerId);
setReferralCode(code);
} catch (error) {
console.log("Failed to get referral code", error);
toast.error(`Error fetching referral code: ${error}`);
}
setLoading(false);