-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
333903f
commit 80b20cd
Showing
11 changed files
with
109 additions
and
219 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
import * as yup from "yup" | ||
import { z } from "zod" | ||
|
||
export enum FieldName { | ||
Password = "password", | ||
Username = "username", | ||
} | ||
|
||
export const validationSchema = yup | ||
.object({ | ||
[FieldName.Password]: yup.string().required(), | ||
[FieldName.Username]: yup.string().required(), | ||
}) | ||
.required() | ||
export const validationSchema = z.object({ | ||
[FieldName.Password]: z.string().nonempty(), | ||
[FieldName.Username]: z.string().nonempty(), | ||
}) | ||
|
||
export const defaultValues: TFormValues = { | ||
password: "", | ||
username: "", | ||
} | ||
export type TFormValidValues = z.infer<typeof validationSchema> | ||
|
||
export type TFormDefaultValues = TFormValidValues | ||
|
||
export type TFormValues = yup.InferType<typeof validationSchema> | ||
export const defaultValues: TFormValidValues = { | ||
[FieldName.Password]: "", | ||
[FieldName.Username]: "", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 11 additions & 8 deletions
19
src/views/boards/BoardSettings/CategoryFormDialog/form-helpers.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,18 @@ | ||
import * as yup from "yup" | ||
import { z } from "zod" | ||
|
||
export enum FieldName { | ||
Name = "name", | ||
TypeId = "typeId", | ||
} | ||
|
||
export const validationSchema = yup | ||
.object({ | ||
name: yup.string().required(), | ||
typeId: yup.number().required(), | ||
}) | ||
.required() | ||
export const validationSchema = z.object({ | ||
[FieldName.Name]: z.string().nonempty(), | ||
[FieldName.TypeId]: z.number(), | ||
}) | ||
|
||
export type TFormValues = yup.InferType<typeof validationSchema> | ||
export type TFormValidValues = z.infer<typeof validationSchema> | ||
|
||
export type TFormDefaultValues = { | ||
[FieldName.Name]: string | ||
[FieldName.TypeId]: number | null | ||
} |
Oops, something went wrong.