action() — ui Function Reference
Architecture documentation for the action() function in join.tsx from the ui codebase.
Entity Profile
Dependency Diagram
graph TD 0c17bdda_32fe_12e7_e7a8_02112af7db24["action()"] 363a3495_339e_af8a_a966_d012d0adc90e["join.tsx"] 0c17bdda_32fe_12e7_e7a8_02112af7db24 -->|defined in| 363a3495_339e_af8a_a966_d012d0adc90e style 0c17bdda_32fe_12e7_e7a8_02112af7db24 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/routes/join.tsx lines 20–68
export const action = async ({ request }: ActionFunctionArgs) => {
const formData = await request.formData();
const email = formData.get("email");
const password = formData.get("password");
const redirectTo = safeRedirect(formData.get("redirectTo"), "/");
if (!validateEmail(email)) {
return json(
{ errors: { email: "Email is invalid", password: null } },
{ status: 400 },
);
}
if (typeof password !== "string" || password.length === 0) {
return json(
{ errors: { email: null, password: "Password is required" } },
{ status: 400 },
);
}
if (password.length < 8) {
return json(
{ errors: { email: null, password: "Password is too short" } },
{ status: 400 },
);
}
const existingUser = await getUserByEmail(email);
if (existingUser) {
return json(
{
errors: {
email: "A user already exists with this email",
password: null,
},
},
{ status: 400 },
);
}
const user = await createUser(email, password);
return createUserSession({
redirectTo,
remember: false,
request,
userId: user.id,
});
};
Domain
Subdomains
Source
Frequently Asked Questions
What does action() do?
action() is a function in the ui codebase, defined in packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/routes/join.tsx.
Where is action() defined?
action() is defined in packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/routes/join.tsx at line 20.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free