@@ -37,7 +37,8 @@ const ResumePage = () => {
3737 const data = await GetResumes ( ) ;
3838 setResumeData ( data ) ;
3939 } catch ( error ) {
40- toast . error ( "Error fetching data:" ) ;
40+ toast . error ( "Error fetching data" ) ;
41+ console . error ( "Error fetching resumes:" , error ) ;
4142 } finally {
4243 setLoading ( false ) ;
4344 }
@@ -51,7 +52,7 @@ const ResumePage = () => {
5152 setFile ( event . target . files [ 0 ] ) ;
5253 }
5354 } ;
54-
55+
5556 const handleNameChange = ( event : ChangeEvent < HTMLInputElement > ) => {
5657 setName ( event . target . value ) ;
5758 } ;
@@ -73,6 +74,15 @@ const ResumePage = () => {
7374 return ;
7475 }
7576
77+ if ( ! file . name . endsWith ( ".pdf" ) ) {
78+ toast . error ( "Only PDF files are allowed." ) ;
79+ return ;
80+ }
81+ if ( file . size > 2 * 1024 * 1024 ) {
82+ toast . error ( "File size exceeds 2MB limit." ) ;
83+ return ;
84+ }
85+
7686 const formData = new FormData ( ) ;
7787 formData . append ( "resume" , file , file . name ) ;
7888
@@ -191,6 +201,10 @@ const ResumePage = () => {
191201 type = "file"
192202 onChange = { handleFileChange }
193203 />
204+ < ul className = "list-disc text-black opacity-70 text-xs pl-5" >
205+ < li > Accepted file types .pdf</ li >
206+ < li > File size < 2 MB.</ li >
207+ </ ul >
194208 </ div >
195209 < DialogFooter >
196210 < Button className = "my-4" type = "submit" >
0 commit comments