Skip to content

Commit

Permalink
feat: added validation filter before registering
Browse files Browse the repository at this point in the history
  • Loading branch information
Srish-ty committed Mar 25, 2024
1 parent f173a1f commit d6429be
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions src/components/form/FormContainer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import { donation, feeCoverage, initialContent, inputContent, lastPartContent }
import { storeFormData } from '../../firebase/registration';

const FormContainer = () => {
// const { userData } = useContext(AuthContext);
const userData = undefined;

const [isValid, setValid] = useState({
recRollNumber: false,
name: false,
Expand Down Expand Up @@ -33,12 +36,9 @@ const FormContainer = () => {

var notAllowed = !checkValidity || checkIfEmpty;
//console.log('checkValidity:', checkValidity, 'checkIfEmpty:', isEmpty);

const [errorMessage, setErrorMessage] = useState('');

const [formData, setFormData] = useState({});
//const [verified, setVerified] = useState(false);
// const { userData } = useContext(AuthContext);
const userData = undefined;
//console.log('formData:', formData);

const setInputValue = (key, value) => {
Expand Down Expand Up @@ -76,16 +76,6 @@ const FormContainer = () => {
const documentId = await storeFormData(formData);
console.log('Document ID:', documentId);
window.alert('Registration Successful');

setFormData({
recRollNumber: '',
name: '',
email: '',
country: '',
state: '',
city: '',
contactNumber: '',
});
} catch (error) {
console.error('Error:', error);
window.alert('Registration Failed');
Expand Down

0 comments on commit d6429be

Please sign in to comment.