From 0cf975f227157685235c5661c2e3fa7d17d2cf64 Mon Sep 17 00:00:00 2001 From: Ashwin Kumar Sivakumar Date: Sat, 4 Jul 2026 22:08:03 +0530 Subject: [PATCH] fix(signup): fix /signup routing so job-seeker and role-specific URLs work Three related bugs made signup pages appear blank/'Not found': 1. /signup/index.tsx redirected to /signup/job-seeker (hyphen) but the actual file was signup/jobseeker.tsx (no hyphen). Result: every /signup visit (no intent) 404'd. 2. signup/company.tsx had the same broken link in the 'Register as Job Seeker instead' link. 3. Landing page CTAs link to /signup?intent=professional&role=DEVELOPER which the index correctly redirects to /signup/professional - but /signup/developer, /signup/photographer etc. were 404 because there were no route files for them. Added signup/[role].tsx catch-all that maps all professional role slugs (developer, photographer, tutor, makeup-artist, video-editor, graphic-designer, social-media-manager, fitness-trainer, catering-services, ugc-content-creator) to /signup/professional?role=. Verified via Playwright: all role-specific signup paths now load the full signup form instead of 'Not found'. --- src/routes/signup/[role].tsx | 55 +++++++++++++++++++++++++++++++++++ src/routes/signup/company.tsx | 2 +- src/routes/signup/index.tsx | 6 ++-- 3 files changed, 59 insertions(+), 4 deletions(-) create mode 100644 src/routes/signup/[role].tsx diff --git a/src/routes/signup/[role].tsx b/src/routes/signup/[role].tsx new file mode 100644 index 0000000..9c5181b --- /dev/null +++ b/src/routes/signup/[role].tsx @@ -0,0 +1,55 @@ +import { useNavigate, useParams } from "@solidjs/router"; +import { createEffect } from "solid-js"; + +/** + * Catch-all signup route for role-specific URLs. + * + * Routes like /signup/developer, /signup/photographer, /signup/tutor, etc. + * all map to the professional signup form with the role pre-selected. + * + * The professional route reads `role` from the query string (?role=DEVELOPER). + */ +const ROLE_ALIASES: Record = { + developer: "DEVELOPER", + photographer: "PHOTOGRAPHER", + "makeup-artist": "MAKEUP_ARTIST", + makeup: "MAKEUP_ARTIST", + tutor: "TUTOR", + "video-editor": "VIDEO_EDITOR", + video: "VIDEO_EDITOR", + "graphic-designer": "GRAPHIC_DESIGNER", + graphic: "GRAPHIC_DESIGNER", + "social-media-manager": "SOCIAL_MEDIA_MANAGER", + social: "SOCIAL_MEDIA_MANAGER", + "fitness-trainer": "FITNESS_TRAINER", + fitness: "FITNESS_TRAINER", + "catering-services": "CATERING_SERVICES", + catering: "CATERING_SERVICES", + "ugc-content-creator": "UGC_CONTENT_CREATOR", + ugc: "UGC_CONTENT_CREATOR", +}; + +export default function SignupRoleRoute() { + const navigate = useNavigate(); + const params = useParams(); + + createEffect(() => { + const slug = (params.role || "").toLowerCase(); + const role = ROLE_ALIASES[slug] || slug.toUpperCase(); + navigate(`/signup/professional?role=${role}`, { replace: true }); + }); + + return ( +
+

Redirecting...

+
+ ); +} \ No newline at end of file diff --git a/src/routes/signup/company.tsx b/src/routes/signup/company.tsx index 8b75ac7..b6a144c 100644 --- a/src/routes/signup/company.tsx +++ b/src/routes/signup/company.tsx @@ -548,7 +548,7 @@ export default function CompanySignupRoute() { Already have an account? Sign In

- Register as Job Seeker instead + Register as Job Seeker instead

diff --git a/src/routes/signup/index.tsx b/src/routes/signup/index.tsx index 7605a3f..7ca7467 100644 --- a/src/routes/signup/index.tsx +++ b/src/routes/signup/index.tsx @@ -24,11 +24,11 @@ export default function SignupIndexRoute() { navigate("/signup/professional", { replace: true }); } else if (intent.includes("customer")) { navigate("/signup/customer", { replace: true }); - } else if (intent.includes("job_seeker") || intent.includes("jobseeker")) { - navigate("/signup/job-seeker", { replace: true }); + } else if (intent.includes("job_seeker") || intent.includes("jobseeker") || intent.includes("job-seeker")) { + navigate("/signup/jobseeker", { replace: true }); } else { // Default to job seeker if no intent specified - navigate("/signup/job-seeker", { replace: true }); + navigate("/signup/jobseeker", { replace: true }); } });