From d44c0c6e1c7d96b69df1866e68cbe586f98c2d0f Mon Sep 17 00:00:00 2001 From: Jerome Hardaway Date: Tue, 10 Dec 2024 16:58:39 -0500 Subject: [PATCH] update GitHub Actions workflows and refine API request handling (#664) * update GitHub Actions workflows and refine API request handling * updated second cache action --- .github/workflows/playwright.yml | 6 +++--- public/mailchimp.js | 1 - src/pages/api/apply.ts | 8 ++++---- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 6bdf0fc77..dbf014e3f 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -12,10 +12,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Cache node modules - uses: actions/cache@v2 + uses: actions/cache@v4 env: cache-name: cache-node-modules with: @@ -37,7 +37,7 @@ jobs: run: yarn - name: Cache Playwright Browsers - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: | ~/.cache/ms-playwright diff --git a/public/mailchimp.js b/public/mailchimp.js index 043479511..5d9343ea6 100644 --- a/public/mailchimp.js +++ b/public/mailchimp.js @@ -1,2 +1 @@ -// public/mailchimp.js !function(c,h,i,m,p){m=c.createElement(h),p=c.getElementsByTagName(h)[0],m.async=1,m.src=i,p.parentNode.insertBefore(m,p)}(document,"script","https://chimpstatic.com/mcjs-connected/js/users/e5c2275b0bdbc424dc0ab4480/9706a936fe91a998a1c6ed3d9.js"); diff --git a/src/pages/api/apply.ts b/src/pages/api/apply.ts index 40862bf92..6bb40d63b 100644 --- a/src/pages/api/apply.ts +++ b/src/pages/api/apply.ts @@ -9,11 +9,11 @@ interface ParsedBody { email?: string; city?: string; state?: string; - zipCode?: string; + zipCode?: number; country?: string; branchOfService?: string; - yearJoined?: string; - yearSeparated?: string; + yearJoined?: number; + yearSeparated?: number; hasAttendedPreviousCourse?: boolean; previousCourses?: string; willAttendAnotherCourse?: boolean; @@ -98,6 +98,6 @@ export default async function handler(req: Request, res: Response) { } catch (err) { // Log the error for debugging and respond with an error message // console.error("Failed to post to #mentor channel:", err); - return res.status(500).json({ message: "Failed to post to #mentor channel" }); + return res.status(500).json({ message: "Failed to post to #apply channel" }); } }