feat(student): fixed greydout botton in jobs application

This commit is contained in:
Unchanted
2025-08-21 14:02:41 +05:30
parent 8bfe681dd4
commit 42a511ccb6
4 changed files with 70 additions and 36 deletions

View File

@@ -140,3 +140,20 @@ export async function getResumes(studentId: number) {
return { success: false, error: 'Failed to fetch resumes' };
}
}
export async function getStudentApplicationJobIds(studentId: number) {
try {
const studentApplications = await db.query.applications.findMany({
where: eq(applications.studentId, studentId),
columns: {
jobId: true,
},
});
const appliedJobIds = studentApplications.map(app => app.jobId);
return { success: true, appliedJobIds };
} catch (error) {
console.error('Error fetching student applied job IDs:', error);
return { success: false, error: 'Failed to fetch applied job IDs' };
}
}