Home / File/ form-next-demo-action.ts — ui Source File

form-next-demo-action.ts — ui Source File

Architecture documentation for form-next-demo-action.ts, a typescript file in the ui codebase. 1 imports, 1 dependents.

File typescript ComponentRegistry ChartRegistry 1 imports 1 dependents 1 functions

Entity Profile

Dependency Diagram

graph LR
  ef956916_247d_d591_7cc9_ba24c57b1db9["form-next-demo-action.ts"]
  40d9dad0_1a0e_66b8_2f97_7511168d16e4["form-next-demo-schema.ts"]
  ef956916_247d_d591_7cc9_ba24c57b1db9 --> 40d9dad0_1a0e_66b8_2f97_7511168d16e4
  5a2a9796_4841_6983_1ce8_67073c663d48["form-next-demo.tsx"]
  5a2a9796_4841_6983_1ce8_67073c663d48 --> ef956916_247d_d591_7cc9_ba24c57b1db9
  style ef956916_247d_d591_7cc9_ba24c57b1db9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"use server"

import { formSchema, type FormState } from "./form-next-demo-schema"

export async function demoFormAction(
  _prevState: FormState,
  formData: FormData
) {
  const values = {
    title: formData.get("title") as string,
    description: formData.get("description") as string,
  }

  const result = formSchema.safeParse(values)

  if (!result.success) {
    return {
      values,
      success: false,
      errors: result.error.flatten().fieldErrors,
    }
  }

  // Do something with the values.
  // Call your database or API here.

  return {
    values: {
      title: "",
      description: "",
    },
    errors: null,
    success: true,
  }
}

Subdomains

Functions

Frequently Asked Questions

What does form-next-demo-action.ts do?
form-next-demo-action.ts is a source file in the ui codebase, written in typescript. It belongs to the ComponentRegistry domain, ChartRegistry subdomain.
What functions are defined in form-next-demo-action.ts?
form-next-demo-action.ts defines 1 function(s): demoFormAction.
What does form-next-demo-action.ts depend on?
form-next-demo-action.ts imports 1 module(s): form-next-demo-schema.ts.
What files import form-next-demo-action.ts?
form-next-demo-action.ts is imported by 1 file(s): form-next-demo.tsx.
Where is form-next-demo-action.ts in the architecture?
form-next-demo-action.ts is located at apps/v4/registry/new-york-v4/examples/form-next-demo-action.ts (domain: ComponentRegistry, subdomain: ChartRegistry, directory: apps/v4/registry/new-york-v4/examples).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free