Skip to content

Commit

Permalink
Merge pull request #71 from heyyakash/new
Browse files Browse the repository at this point in the history
added toml file
  • Loading branch information
heyyakash authored Nov 27, 2023
2 parents 12343ba + 760fed6 commit fad12cd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[[redirects]]
from = "/*"
to = "/index.html"
status = 200
7 changes: 4 additions & 3 deletions src/components/Form/Form.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ const Form = () => {
const [regInput, setRegInput] = useState("")
const [display, setDisplay] = useState(false)
const [disabled,setDisabled] = useState(false)
const usnRegex = /^1DS\w{7}$/
const usn2ndYearRegex = /^1DS22\w{5}$/
const usn3rdYearRegex = /^1DS21\w{5}$/
const phoneRegex = /^\d{10}$/
const admnRegex = /^23UGDS\w{4}$/

Expand Down Expand Up @@ -56,8 +57,8 @@ const Form = () => {
}
}
else {
if (!usnRegex.test(usn)) {
toast.error("Please enter a valid USN", { duration: 3500 })
if ( (!usn2ndYearRegex.test(usn) && dataa.year==="2") || (!usn3rdYearRegex.test(usn) && dataa.year==="3") ) {
toast.error("Please enter a valid USN according to your year", { duration: 3500 })
return
}

Expand Down

0 comments on commit fad12cd

Please sign in to comment.