mirror of
https://gitea.gofwd.group/dstrawsb/ballistic-builder.git
synced 2025-12-06 02:36:44 -05:00
userRegistration work
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
import { useState } from 'react'
|
||||
import { useRouter } from 'next/navigation'
|
||||
|
||||
import { addUser } from "@actions/userActions"
|
||||
export default function RegistrationForm() {
|
||||
const router = useRouter()
|
||||
const [error, setError] = useState('')
|
||||
@@ -16,14 +16,17 @@ export default function RegistrationForm() {
|
||||
const handleSubmit = async (e: React.FormEvent) => {
|
||||
e.preventDefault()
|
||||
setError('')
|
||||
|
||||
alert('in the submit');
|
||||
alert(formData.password + ":" + formData.confirmPassword);
|
||||
if (formData.password !== formData.confirmPassword) {
|
||||
setError('Passwords do not match')
|
||||
console.log("password no match");
|
||||
alert('password no match');
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
// Add your registration API call here
|
||||
addUser(formData.name, formData.name, formData.name, formData.email, formData.password);
|
||||
console.log('Form submitted:', formData)
|
||||
router.push('/signin') // Redirect to login after successful registration
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user