Generate tailored resume artifacts and redirect to Shoulder-Surfing Mode when AI Auto-Apply is clicked
This commit is contained in:
+51
-14
@@ -316,20 +316,57 @@ export default function App() {
|
||||
jobFeeds={jobFeeds}
|
||||
onTailorJobFeed={(item) => handleNavigateToWalkthrough(item.url)}
|
||||
onQuickApplyFeed={async (item) => {
|
||||
await handleSaveApplicationRecord({
|
||||
company: item.company,
|
||||
role: item.title,
|
||||
platform: item.platform,
|
||||
location: item.location,
|
||||
salaryRange: item.salary,
|
||||
status: 'Applied',
|
||||
matchScore: item.estimatedMatch,
|
||||
appliedAt: new Date().toISOString(),
|
||||
jobUrl: item.url,
|
||||
jobDescription: item.description,
|
||||
autoApplied: true,
|
||||
timeline: [{ date: new Date().toLocaleDateString(), action: 'Quick AI Auto-Applied from feed' }]
|
||||
});
|
||||
// Auto-generate tailored bullet points & cover letter before logging
|
||||
try {
|
||||
const res = await fetch('/api/gemini/tailor-resume', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
resumeText: userProfile.resumeText,
|
||||
jobDescription: item.description,
|
||||
companyName: item.company,
|
||||
jobTitle: item.title
|
||||
})
|
||||
});
|
||||
const data = await res.json();
|
||||
const tailoredData = data.success ? data.tailored : {};
|
||||
|
||||
await handleSaveApplicationRecord({
|
||||
company: item.company,
|
||||
role: item.title,
|
||||
platform: item.platform,
|
||||
location: item.location,
|
||||
salaryRange: item.salary,
|
||||
status: 'Applied',
|
||||
matchScore: item.estimatedMatch || tailoredData.matchScore || 88,
|
||||
appliedAt: new Date().toISOString(),
|
||||
jobUrl: item.url,
|
||||
jobDescription: item.description,
|
||||
tailoredResume: tailoredData.tailoredResumeText || `• Tailored for ${item.title} at ${item.company}`,
|
||||
coverLetter: tailoredData.coverLetter || `Dear Hiring Team at ${item.company},\n\nI am writing to express my strong interest in the ${item.title} role...`,
|
||||
autoApplied: true,
|
||||
timeline: [{ date: new Date().toLocaleDateString(), action: 'AI Tailored & Form Filled' }]
|
||||
});
|
||||
|
||||
// Navigate to Walkthrough Tailor tab to inspect in Shoulder Surfing Mode
|
||||
setSelectedJobUrl(item.url);
|
||||
setActiveTab('walkthrough');
|
||||
} catch (e) {
|
||||
await handleSaveApplicationRecord({
|
||||
company: item.company,
|
||||
role: item.title,
|
||||
platform: item.platform,
|
||||
location: item.location,
|
||||
salaryRange: item.salary,
|
||||
status: 'Applied',
|
||||
matchScore: item.estimatedMatch || 85,
|
||||
appliedAt: new Date().toISOString(),
|
||||
jobUrl: item.url,
|
||||
jobDescription: item.description,
|
||||
autoApplied: true,
|
||||
timeline: [{ date: new Date().toLocaleDateString(), action: 'Quick AI Auto-Applied' }]
|
||||
});
|
||||
}
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user