Skip to content

Commit

Permalink
refactor: streamline fiat-without-login handling in buy fraction hook
Browse files Browse the repository at this point in the history
  • Loading branch information
dipanshuhappy committed Nov 5, 2024
1 parent 43dd34e commit 32aee01
Showing 1 changed file with 30 additions and 30 deletions.
60 changes: 30 additions & 30 deletions hooks/use-buy-fraction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,36 +206,36 @@ const useHandleBuyFraction = (
name,
images
);
// case "fiat-without-login": {
// if (!email) {
// throw new Error("Email is required for fiat-without-login");
// }
// const wallet : {wallet:User} = await fetch("/api/wallet-generate", {
// method: "POST",
// headers: {
// "Content-Type": "application/json",
// },
// body: JSON.stringify({
// address: email,
// }),
// }).then((res) => res.json());
// if(!wallet.wallet.wallet?.address){
// setTransactionStatus("Failed");

// return
// }
// return handleFiatBuyFraction(
// order,
// amount,
// wallet.wallet.wallet.address as Address,
// hypercertId,
// comment,
// amountInDollars,
// email,
// name,
// images
// );
// }
case "fiat-without-login": {
if (!email) {
throw new Error("Email is required for fiat-without-login");
}
const wallet : {wallet:User} = await fetch("/api/wallet-generate", {

Check failure on line 213 in hooks/use-buy-fraction.ts

View workflow job for this annotation

GitHub Actions / test (typecheck)

Cannot find name 'User'.
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
address: email,
}),
}).then((res) => res.json());
if(!wallet.wallet.wallet?.address){
setTransactionStatus("Failed");

return
}
return handleFiatBuyFraction(
order,
amount,
wallet.wallet.wallet.address as Address,
hypercertId,
comment,
amountInDollars,
email,
name,
images
);
}


}
Expand Down

0 comments on commit 32aee01

Please sign in to comment.