Skip to content

Commit

Permalink
Update actions.ts
Browse files Browse the repository at this point in the history
fixed depricated nonempty()
  • Loading branch information
Mustafadagkiranlar committed Oct 8, 2023
1 parent dbf35a7 commit f469101
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/next-forms/app/actions.ts
Expand Up @@ -11,7 +11,7 @@ import { z } from 'zod'

export async function createTodo(prevState: any, formData: FormData) {
const schema = z.object({
todo: z.string().nonempty(),
todo: z.string().min(1),
})
const data = schema.parse({
todo: formData.get('todo'),
Expand All @@ -32,8 +32,8 @@ export async function createTodo(prevState: any, formData: FormData) {

export async function deleteTodo(prevState: any, formData: FormData) {
const schema = z.object({
id: z.string().nonempty(),
todo: z.string().nonempty(),
id: z.string().min(1),
todo: z.string().min(1),
})
const data = schema.parse({
id: formData.get('id'),
Expand Down

0 comments on commit f469101

Please sign in to comment.