Skip to content

Commit

Permalink
fix for lint format.
Browse files Browse the repository at this point in the history
  • Loading branch information
samuraikun committed Feb 24, 2024
1 parent 696293f commit ab9868b
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions app/activity/schema.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
import { zodResolver } from '@hookform/resolvers/zod'
import * as z from 'zod'

const activitySchema = z.object({
title: z.string().min(1, { message: 'Please enter a title' }),
timeFrom: z.date({
required_error: 'Please select a date from',
invalid_type_error: "That's not a date"
}),
timeTo: z.date().nullable(),
address: z.string().min(0).max(50).nullable(),
url: z.union([z.string().url().nullish(), z.literal('')]),
memo: z.string().min(0).max(300).nullable(),
cost: z.string().nullable(),
costUnit: z.string().nullable(),
uploadedFileUrls: z.array(z.string()).optional(),
newFiles: z.array(z.instanceof(File)).optional()
})
const activitySchema = z
.object({
title: z.string().min(1, { message: 'Please enter a title' }),
timeFrom: z.date({
required_error: 'Please select a date from',
invalid_type_error: "That's not a date"
}),
timeTo: z.date().nullable(),
address: z.string().min(0).max(50).nullable(),
url: z.union([z.string().url().nullish(), z.literal('')]),
memo: z.string().min(0).max(300).nullable(),
cost: z.string().nullable(),
costUnit: z.string().nullable(),
uploadedFileUrls: z.array(z.string()).optional(),
newFiles: z.array(z.instanceof(File)).optional()
})
.refine(
args => {
(args) => {
if (!args.timeTo) return true

const { timeFrom, timeTo } = args
Expand Down

0 comments on commit ab9868b

Please sign in to comment.