Skip to content

Commit

Permalink
send status after adding to sheet
Browse files Browse the repository at this point in the history
  • Loading branch information
ptbarnum4 committed Feb 11, 2025
1 parent fcbe89b commit a27330e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pages/api/signups/training.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,10 @@ export default async function handleContactForm(req: ISignupReq, res: NextApiRes
values: row,
});

// TODO: Send email confirmation with details
// Send the response. don't wait for the email or slack message to finish
res.status(201).end();

// Finish sending the email and slack message
type MgVariables = {
title: string;
subject: string;
Expand Down Expand Up @@ -269,7 +271,7 @@ export default async function handleContactForm(req: ISignupReq, res: NextApiRes
console.error('Error sending Slack message:', error);
}

res.status(201).end();
// Status sent after details added to spreadsheet above
} catch (error) {
console.error('Error handling contact form:', error);
res.status(500).end();
Expand Down

0 comments on commit a27330e

Please sign in to comment.