Skip to content

Commit

Permalink
style: 🎨 format code with Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Sep 30, 2023
1 parent e558be0 commit 3c40c73
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions website/fileSharing.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ async function getArchivedPhotosUrl(purchasedItems) {
headers: {
Authorization: `Bearer ${idToken}`,
},
}
},
);
return response.data.url;
}
Expand All @@ -37,7 +37,7 @@ async function sendEmail(
photosUrl,
customerEmail,
customerName,
purchasedItems
purchasedItems,
) {
const transporter = nodemailer.createTransport({
service: "gmail",
Expand Down Expand Up @@ -100,7 +100,7 @@ function sendErrorEmails(
customerEmail,
customerName,
error,
retries = 5
retries = 5,
) {
// Email configuration
const transporter = nodemailer.createTransport({
Expand Down Expand Up @@ -157,21 +157,21 @@ function sendErrorEmails(
if (err) {
console.error(
`Error sending error email (attempt ${attempts}):`,
err
err,
);
if (attempts < retries) {
setTimeout(() => {
sendEmailWithRetry(attempts + 1);
}, 20000);
} else {
console.error(
"Max retry attempts reached. Email not sent."
"Max retry attempts reached. Email not sent.",
);
}
} else {
console.log("Error emails sent:", info.response);
}
}
},
);
}

Expand Down
6 changes: 3 additions & 3 deletions website/handlePurchase.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const webhookVerifyMiddleware = (request, response, next) => {
stripe.webhooks.constructEvent(
request.rawBody,
sigHeader,
webhookSecret
webhookSecret,
);
next();
} catch (error) {
Expand Down Expand Up @@ -46,15 +46,15 @@ const handleCheckoutSession = (req, res) => {
fileSharing.handlePhotos(
purchasedItems,
customerEmail,
customerName
customerName,
);
res.status(200);
} catch (error) {
fileSharing.sendErrorEmails(
purchasedItems,
customerEmail,
customerName,
error
error,
);
res.status(500).json({ error: e.message });
console.error(error);
Expand Down

0 comments on commit 3c40c73

Please sign in to comment.