-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allowed admin to change emails in form
- Loading branch information
1 parent
a56ba4c
commit 047bee6
Showing
2 changed files
with
17 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -151,6 +151,7 @@ export default function RegistrationForm() { | |
method: "POST", | ||
headers: { "Content-Type": "application/json" }, | ||
body: JSON.stringify({ | ||
email: form.getValues("email"), | ||
orderId: response.razorpay_order_id, | ||
razorpayPaymentId: response.razorpay_payment_id, | ||
razorpaySignature: response.razorpay_signature, | ||
|
@@ -218,7 +219,7 @@ export default function RegistrationForm() { | |
}, | ||
notes: { | ||
name: form.getValues("name"), | ||
email: session?.user?.email, | ||
email: form.getValues("email"), | ||
contact: form.getValues("phone"), | ||
designation: form.getValues("designation"), | ||
foodPreference: form.getValues("foodPreference"), | ||
|
@@ -233,7 +234,7 @@ export default function RegistrationForm() { | |
}, | ||
prefill: { | ||
name: form.getValues("name"), | ||
email: session?.user?.email, | ||
email: form.getValues("email"), | ||
contact: form.getValues("phone"), | ||
}, | ||
theme: { | ||
|
@@ -299,7 +300,7 @@ export default function RegistrationForm() { | |
const handleNext = async () => { | ||
let isValid = false; | ||
if (step === 1) { | ||
isValid = await form.trigger(["designation", "foodPreference", "name"]); | ||
isValid = await form.trigger(["designation", "foodPreference", "name", "email"]); | ||
} else if (step === 2) { | ||
const designation = form.getValues("designation"); | ||
if (designation === "student") { | ||
|
@@ -380,10 +381,10 @@ export default function RegistrationForm() { | |
<div className="flex items-center space-x-2"> | ||
<FormControl> | ||
<Input | ||
placeholder="[email protected]" | ||
placeholder="" | ||
{...field} | ||
disabled | ||
value={session?.user.email!} | ||
disabled={!(session?.user.role === "ADMIN")} | ||
className="cursor-not-allowed" | ||
/> | ||
</FormControl> | ||
<Button | ||
|