mirror of
https://github.com/Nezumi-2711/react-training.git
synced 2026-09-22 13:38:51 +00:00
Optimzed code and updated gitignore
This commit is contained in:
@@ -12,6 +12,8 @@ dist
|
||||
dist-ssr
|
||||
*.local
|
||||
|
||||
src/db.json
|
||||
|
||||
# Editor directories and files
|
||||
.vscode/*
|
||||
!.vscode/extensions.json
|
||||
|
||||
@@ -1,84 +0,0 @@
|
||||
{
|
||||
"users": [
|
||||
{
|
||||
"id": 1,
|
||||
"name": "Nezumi",
|
||||
"identifiedCode": "123",
|
||||
"phone": "0937425123",
|
||||
"roomId": 246,
|
||||
"address": "Da Nang"
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"name": "Nezumi",
|
||||
"identifiedCode": "123",
|
||||
"phone": "0937425123",
|
||||
"roomId": 246,
|
||||
"address": "Da Nang"
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"name": "Nezumi",
|
||||
"identifiedCode": "123",
|
||||
"phone": "0937425123",
|
||||
"roomId": 246,
|
||||
"address": "Da Nang"
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"name": "Nezumi",
|
||||
"identifiedCode": "123",
|
||||
"phone": "0937425123",
|
||||
"roomId": 246,
|
||||
"address": "Da Nang"
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"name": "Nezumi",
|
||||
"identifiedCode": "123",
|
||||
"phone": "0937425123",
|
||||
"roomId": 246,
|
||||
"address": "Da Nang"
|
||||
},
|
||||
{
|
||||
"id": 8,
|
||||
"name": "Nezumi",
|
||||
"identifiedCode": "123",
|
||||
"phone": "0937425123",
|
||||
"roomId": 246,
|
||||
"address": "Da Nang"
|
||||
},
|
||||
{
|
||||
"id": 9,
|
||||
"name": "Nezumi",
|
||||
"identifiedCode": "123",
|
||||
"phone": "0937425123",
|
||||
"roomId": 246,
|
||||
"address": "Da Nang"
|
||||
},
|
||||
{
|
||||
"name": "Nezumi",
|
||||
"identifiedCode": "3212",
|
||||
"phone": "0327768351",
|
||||
"roomId": "213",
|
||||
"address": "32131212312",
|
||||
"id": 10
|
||||
},
|
||||
{
|
||||
"name": "Nezumi",
|
||||
"identifiedCode": "123",
|
||||
"phone": "0937425123",
|
||||
"roomId": "24632",
|
||||
"address": "Da Nang232321",
|
||||
"id": 13
|
||||
},
|
||||
{
|
||||
"id": 17,
|
||||
"name": "Phan Huu Loi",
|
||||
"identifiedCode": "123",
|
||||
"phone": "0937425123",
|
||||
"roomId": "246",
|
||||
"address": "233123132131321"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -66,13 +66,11 @@ const UserForm = ({
|
||||
isAdd,
|
||||
}: IUserFormProp) => {
|
||||
const [reset, setReset] = useState(true);
|
||||
let initialValue: string = '';
|
||||
|
||||
if (isAdd) {
|
||||
initialValue = '';
|
||||
} else if (user) {
|
||||
initialValue = user.id;
|
||||
}
|
||||
// prettier-ignore
|
||||
const initialValue: string = isAdd
|
||||
? ''
|
||||
: user!
|
||||
&& user.id;
|
||||
|
||||
// Define your state schema
|
||||
const stateSchema: TStateSchema = {
|
||||
|
||||
Reference in New Issue
Block a user