Skip to content

Commit

Permalink
chore: zod use min over nonempty
Browse files Browse the repository at this point in the history
  • Loading branch information
qin-guan committed Oct 22, 2023
1 parent e631863 commit fa3a24f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions components/onboarding/SetupStep01.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ const { $client } = useNuxtApp()
const toast = useToast()
const schema = z.object({
username: z.string().nonempty('Username must not be empty'),
password: z.string().nonempty('Password must not be empty'),
username: z.string().min(1, 'Username must not be empty'),
password: z.string().min(1, 'Password must not be empty'),
})
const state = ref<{
Expand Down
4 changes: 2 additions & 2 deletions pages/login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ definePageMeta({
const { $client } = useNuxtApp()
const schema = z.object({
username: z.string().nonempty('Username must not be empty'),
password: z.string().nonempty('Password must not be empty'),
username: z.string().min(1, 'Username must not be empty'),
password: z.string().min(1, 'Password must not be empty'),
})
const state = ref<{
Expand Down
4 changes: 2 additions & 2 deletions server/trpc/modules/onboarding/onboarding.router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ export const onboardingRouter = router({
return next()
})
.input(z.object({
username: z.string().nonempty(),
password: z.string().nonempty().min(8),
username: z.string().min(1),
password: z.string().min(8),
}))
.mutation(async ({ ctx, input }) => {
try {
Expand Down

0 comments on commit fa3a24f

Please sign in to comment.