Skip to content

Commit

Permalink
nextlove supports .optional on formData
Browse files Browse the repository at this point in the history
  • Loading branch information
kainpets committed Nov 10, 2023
1 parent 66d9b2f commit 48859c3
Show file tree
Hide file tree
Showing 3 changed files with 619 additions and 1,130 deletions.
11 changes: 4 additions & 7 deletions apps/example-todo-app/tests/api/todo/form-add.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import getTestServer from "tests/fixtures/get-test-server"
import { v4 as uuidv4 } from "uuid"
import { formData } from "pages/api/todo/form-add"
import { withRouteSpec } from "lib/middlewares"
import * as z from "zod"
import * as z from "zod"

test("POST /todo/form-add", async (t) => {
const { axios } = await getTestServer(t)
Expand Down Expand Up @@ -38,12 +38,9 @@ test("Workspace supports an optional object of formData", async (t) => {
workspace_id: z.string(),
}),
formData: z
.object([
z.any(),
z.object({
clear_sandbox_state: z.literal("clear_sandbox_state"),
}),
])
.object({
clear_sandbox_state: z.literal("clear_sandbox_state"),
})
.optional(),
} as const)

Expand Down
Loading

0 comments on commit 48859c3

Please sign in to comment.