Refactored forms
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
import { Validate } from "react-hook-form";
|
||||
|
||||
export interface CreateFieldTypes {
|
||||
string: 'string';
|
||||
number: 'number';
|
||||
@ -9,7 +11,12 @@ export interface CreateFieldTypes {
|
||||
custom: 'custom';
|
||||
}
|
||||
|
||||
export interface InputTypes {
|
||||
password: 'password';
|
||||
}
|
||||
|
||||
export type CreateFieldType = CreateFieldTypes[keyof CreateFieldTypes]
|
||||
export type InputType = InputTypes[keyof InputTypes]
|
||||
|
||||
export interface CreateField {
|
||||
key: string;
|
||||
@ -17,4 +24,8 @@ export interface CreateField {
|
||||
type: CreateFieldType;
|
||||
required?: boolean;
|
||||
defaultValue?: any;
|
||||
inputType?: InputType;
|
||||
validate?: Validate<string, boolean>;
|
||||
watch?: string;
|
||||
watchMessage?: string;
|
||||
}
|
@ -1,9 +1,10 @@
|
||||
export interface IUserCreate {
|
||||
export interface IUser {
|
||||
id: number;
|
||||
password: string;
|
||||
email: string;
|
||||
login: string;
|
||||
phone: string;
|
||||
name: string;
|
||||
surname: string;
|
||||
is_active: boolean;
|
||||
password: string;
|
||||
}
|
Reference in New Issue
Block a user