Merge branch 'codex/fix-invite-activation'
This commit is contained in:
@@ -53,8 +53,6 @@ export type InviteState = {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
export const initialInviteState: InviteState = { attempt: 0 };
|
|
||||||
|
|
||||||
function echoCheckboxValues(formData: FormData): InviteState["values"] {
|
function echoCheckboxValues(formData: FormData): InviteState["values"] {
|
||||||
return {
|
return {
|
||||||
acceptPrivacyPolicy: formData.get("acceptPrivacyPolicy") === "on",
|
acceptPrivacyPolicy: formData.get("acceptPrivacyPolicy") === "on",
|
||||||
|
|||||||
@@ -6,7 +6,9 @@ import { Button } from "@/components/ui/button";
|
|||||||
import { Input } from "@/components/ui/input";
|
import { Input } from "@/components/ui/input";
|
||||||
import { Label } from "@/components/ui/label";
|
import { Label } from "@/components/ui/label";
|
||||||
import { Checkbox } from "@/components/ui/checkbox";
|
import { Checkbox } from "@/components/ui/checkbox";
|
||||||
import { acceptInviteAction, initialInviteState } from "./actions";
|
import { acceptInviteAction, type InviteState } from "./actions";
|
||||||
|
|
||||||
|
const initialInviteState: InviteState = { attempt: 0 };
|
||||||
|
|
||||||
// =====================================================================
|
// =====================================================================
|
||||||
// InviteForm · Client Component
|
// InviteForm · Client Component
|
||||||
|
|||||||
@@ -70,8 +70,6 @@ export type OnboardingState = {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
export const initialOnboardingState: OnboardingState = { attempt: 0 };
|
|
||||||
|
|
||||||
function echoValues(formData: FormData): OnboardingState["values"] {
|
function echoValues(formData: FormData): OnboardingState["values"] {
|
||||||
const min = formData.get("notdienstMinPerChildPerMonth");
|
const min = formData.get("notdienstMinPerChildPerMonth");
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -7,10 +7,9 @@ import { Checkbox } from "@/components/ui/checkbox";
|
|||||||
import { Input } from "@/components/ui/input";
|
import { Input } from "@/components/ui/input";
|
||||||
import { Label } from "@/components/ui/label";
|
import { Label } from "@/components/ui/label";
|
||||||
|
|
||||||
import {
|
import { completeOnboardingAction, type OnboardingState } from "./actions";
|
||||||
completeOnboardingAction,
|
|
||||||
initialOnboardingState,
|
const initialOnboardingState: OnboardingState = { attempt: 0 };
|
||||||
} from "./actions";
|
|
||||||
|
|
||||||
export function OnboardingForm() {
|
export function OnboardingForm() {
|
||||||
const [state, formAction, pending] = useActionState(
|
const [state, formAction, pending] = useActionState(
|
||||||
|
|||||||
@@ -52,8 +52,6 @@ export type RegisterState = {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
export const initialRegisterState: RegisterState = { attempt: 0 };
|
|
||||||
|
|
||||||
function echoValues(formData: FormData): RegisterState["values"] {
|
function echoValues(formData: FormData): RegisterState["values"] {
|
||||||
return {
|
return {
|
||||||
firstName: String(formData.get("firstName") ?? ""),
|
firstName: String(formData.get("firstName") ?? ""),
|
||||||
|
|||||||
@@ -7,7 +7,9 @@ import { Checkbox } from "@/components/ui/checkbox";
|
|||||||
import { Input } from "@/components/ui/input";
|
import { Input } from "@/components/ui/input";
|
||||||
import { Label } from "@/components/ui/label";
|
import { Label } from "@/components/ui/label";
|
||||||
|
|
||||||
import { initialRegisterState, registerAction } from "./actions";
|
import { registerAction, type RegisterState } from "./actions";
|
||||||
|
|
||||||
|
const initialRegisterState: RegisterState = { attempt: 0 };
|
||||||
|
|
||||||
export function RegisterForm() {
|
export function RegisterForm() {
|
||||||
const [state, formAction, pending] = useActionState(
|
const [state, formAction, pending] = useActionState(
|
||||||
|
|||||||
Reference in New Issue
Block a user