fix(signup): fix /signup routing so job-seeker and role-specific URLs work
Some checks failed
build-and-release / build (push) Failing after 1m17s
Some checks failed
build-and-release / build (push) Failing after 1m17s
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=<ROLE>. Verified via Playwright: all role-specific signup paths now load the full signup form instead of 'Not found'.
This commit is contained in:
parent
c06860367c
commit
0cf975f227
3 changed files with 59 additions and 4 deletions
55
src/routes/signup/[role].tsx
Normal file
55
src/routes/signup/[role].tsx
Normal file
|
|
@ -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<string, string> = {
|
||||||
|
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 (
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
display: "flex",
|
||||||
|
"justify-content": "center",
|
||||||
|
"align-items": "center",
|
||||||
|
"min-height": "100vh",
|
||||||
|
background: "#07051a",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<p style={{ color: "#fff" }}>Redirecting...</p>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -548,7 +548,7 @@ export default function CompanySignupRoute() {
|
||||||
Already have an account? <A href="/login">Sign In</A>
|
Already have an account? <A href="/login">Sign In</A>
|
||||||
</p>
|
</p>
|
||||||
<p class="note" style={{ "margin-top": "8px" }}>
|
<p class="note" style={{ "margin-top": "8px" }}>
|
||||||
<A href="/signup/job-seeker">Register as Job Seeker instead</A>
|
<A href="/signup/jobseeker">Register as Job Seeker instead</A>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</Show>
|
</Show>
|
||||||
|
|
|
||||||
|
|
@ -24,11 +24,11 @@ export default function SignupIndexRoute() {
|
||||||
navigate("/signup/professional", { replace: true });
|
navigate("/signup/professional", { replace: true });
|
||||||
} else if (intent.includes("customer")) {
|
} else if (intent.includes("customer")) {
|
||||||
navigate("/signup/customer", { replace: true });
|
navigate("/signup/customer", { replace: true });
|
||||||
} else if (intent.includes("job_seeker") || intent.includes("jobseeker")) {
|
} else if (intent.includes("job_seeker") || intent.includes("jobseeker") || intent.includes("job-seeker")) {
|
||||||
navigate("/signup/job-seeker", { replace: true });
|
navigate("/signup/jobseeker", { replace: true });
|
||||||
} else {
|
} else {
|
||||||
// Default to job seeker if no intent specified
|
// Default to job seeker if no intent specified
|
||||||
navigate("/signup/job-seeker", { replace: true });
|
navigate("/signup/jobseeker", { replace: true });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue