diff --git a/apps/portal/src/pages/resumes/submit.tsx b/apps/portal/src/pages/resumes/submit.tsx index fc573f14..e6adec0f 100644 --- a/apps/portal/src/pages/resumes/submit.tsx +++ b/apps/portal/src/pages/resumes/submit.tsx @@ -6,7 +6,7 @@ import { useMemo, useState } from 'react'; import type { SubmitHandler } from 'react-hook-form'; import { useForm } from 'react-hook-form'; import { PaperClipIcon } from '@heroicons/react/24/outline'; -import { Button, Select, TextArea, TextInput } from '@tih/ui'; +import { Button, CheckboxInput, Select, TextArea, TextInput } from '@tih/ui'; import { EXPERIENCE, @@ -17,17 +17,19 @@ import { import { RESUME_STORAGE_KEY } from '~/constants/file-storage-keys'; import { trpc } from '~/utils/trpc'; +const FILE_SIZE_LIMIT_MB = 3; +const FILE_SIZE_LIMIT_BYTES = FILE_SIZE_LIMIT_MB * 1000000; + const TITLE_PLACEHOLDER = 'e.g. Applying for Company XYZ, please help me to review!'; const ADDITIONAL_INFO_PLACEHOLDER = `e.g. I’m applying for company XYZ. I have been resume-rejected by N companies that I have applied for. Please help me to review so company XYZ gives me an interview!`; -const FILE_UPLOAD_ERROR = 'Please upload a PDF file that is less than 3MB.'; - -const MAX_FILE_SIZE_LIMIT = 3000000; +const FILE_UPLOAD_ERROR = `Please upload a PDF file that is less than ${FILE_SIZE_LIMIT_MB}MB.`; type IFormInput = { additionalInfo?: string; experience: string; file: File; + isChecked: boolean; location: string; role: string; title: string; @@ -67,7 +69,11 @@ export default function SubmitResumeForm() { const { url } = res.data; await resumeCreateMutation.mutate({ - ...data, + additionalInfo: data.additionalInfo, + experience: data.experience, + location: data.location, + role: data.role, + title: data.title, url, }); router.push('/resumes'); @@ -78,7 +84,7 @@ export default function SubmitResumeForm() { if (file == null) { return; } - if (file.type !== 'application/pdf' || file.size > MAX_FILE_SIZE_LIMIT) { + if (file.type !== 'application/pdf' || file.size > FILE_SIZE_LIMIT_BYTES) { setInvalidFileUploadError(FILE_UPLOAD_ERROR); return; } @@ -186,14 +192,16 @@ export default function SubmitResumeForm() { /> -

PDF up to 3MB

+

+ PDF up to {FILE_SIZE_LIMIT_MB}MB +

{fileUploadError && (

{fileUploadError}

)} -
+