diff --git a/src/components/Home.js b/src/components/Home.js
index 465912e..5cdb3f3 100644
--- a/src/components/Home.js
+++ b/src/components/Home.js
@@ -1,4 +1,4 @@
-import {Button, TextInput, rem, PasswordInput} from '@mantine/core';
+import {Button, TextInput, rem, PasswordInput, Text} from '@mantine/core';
import { IconAt } from '@tabler/icons-react';
import {useState} from 'react';
import {http} from "../middleware/axiosConfig";
@@ -25,17 +25,38 @@ function Home() {
// Initialize state to handle loading state
const [loading,setLoading]=useState()
+ const [errors, setErrors] =useState({})
+
+
//Inserts new account to the Database{reactapp.users}.post
const onSubmitChange = async (e) => {
e.preventDefault();
- try{
- const response= await http.post("/api/addnew", userField);
- console.log(response)
- setLoading(true);
- } catch(err){
- console.error(err)
- console.log("Something's Wrong!");
+ //validation for errors
+ const validationErrors = {}
+ if (!userField.name.trim()){
+ validationErrors.name =