From af8187c43c25eda5c6bce9e30463786bc29a50d2 Mon Sep 17 00:00:00 2001 From: Dev Sharma Date: Sun, 3 Nov 2024 09:41:25 +0530 Subject: [PATCH] fix error messages --- src/actions/hr.actions.ts | 2 +- src/components/AddHRForm.tsx | 33 +++++++++++++++++++----------- src/components/HRPassword.tsx | 5 +++-- src/lib/validators/hr.validator.ts | 2 +- 4 files changed, 26 insertions(+), 16 deletions(-) diff --git a/src/actions/hr.actions.ts b/src/actions/hr.actions.ts index ba9a2e8d..0535b237 100644 --- a/src/actions/hr.actions.ts +++ b/src/actions/hr.actions.ts @@ -55,10 +55,10 @@ export const createHR = withSession< data: { email: email, password: hashedPassword, - isVerified: true, name: name, role: 'HR', companyId: company.id, + emailVerified: new Date(), }, }); diff --git a/src/components/AddHRForm.tsx b/src/components/AddHRForm.tsx index 78fe88a0..5cd2ec58 100644 --- a/src/components/AddHRForm.tsx +++ b/src/components/AddHRForm.tsx @@ -9,6 +9,7 @@ import { FormField, FormItem, FormLabel, + FormMessage, } from '@/components/ui/form'; import { useToast } from './ui/use-toast'; import { uploadFileAction } from '@/actions/upload-to-cdn'; @@ -155,14 +156,17 @@ const AddHRForm = () => { name="name" render={({ field }) => ( - Name * + + Name * + + )} /> @@ -171,29 +175,32 @@ const AddHRForm = () => { name="email" render={({ field }) => ( - Email * + + Email * + + )} />
-

- Company +

+ Company Details

{/* Logo Upload Section */}
{previewImg ? ( @@ -226,7 +233,7 @@ const AddHRForm = () => { accept="image/*" onChange={handleFileChange} /> -

+

Click the avatar to change or upload your company logo

@@ -239,22 +246,23 @@ const AddHRForm = () => { name="companyName" render={({ field }) => ( - + Company Name * + )} />
-
@@ -264,6 +272,7 @@ const AddHRForm = () => { onDescriptionChange={handleDescriptionChange} placeholder={'Tell us about your company'} /> +
diff --git a/src/components/HRPassword.tsx b/src/components/HRPassword.tsx index f5d47667..acc8f913 100644 --- a/src/components/HRPassword.tsx +++ b/src/components/HRPassword.tsx @@ -34,14 +34,15 @@ const HRPassword = ({ } return ( <> -
+

HR Created Successfully! Below are the details

-
+

Password