-
Notifications
You must be signed in to change notification settings - Fork 456
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat-job-seeker-ui
- Loading branch information
Showing
58 changed files
with
702 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,22 +12,21 @@ import bcrypt from 'bcryptjs'; | |
const prisma = new PrismaClient(); | ||
|
||
const users = [ | ||
{ id: '1', name: 'Jack', email: '[email protected]', role: Role.USER }, | ||
{ | ||
id: '2', | ||
name: 'Admin', | ||
email: '[email protected]', | ||
role: Role.ADMIN, | ||
onBoard: true, | ||
}, | ||
{ | ||
id: '3', | ||
name: 'Hr', | ||
email: '[email protected]', | ||
role: Role.HR, | ||
}, | ||
{ id: '1', name: 'Jack', email: '[email protected]' }, | ||
{ id: '2', name: 'Admin', email: '[email protected]', role: Role.ADMIN, onBoard: true }, | ||
{ id: '3', companyId: '1', name: 'Hr', email: '[email protected]', role: Role.HR, onBoard: true }, | ||
{ id: '4', companyId: '2', name: 'John', email: '[email protected]', role: Role.HR, onBoard: true }, | ||
{ id: '5', companyId: '3', name: 'Jane', email: '[email protected]', role: Role.HR, onBoard: true }, | ||
]; | ||
|
||
|
||
const companies = [ | ||
{ id: '1', compnayEmail: "[email protected]", companyName: 'Tech Corp', companyBio: 'Leading tech solutions provider specializing in innovative web development.', companyLogo: '/main.svg' }, | ||
{ id: '2', companyEmail: "[email protected]", companyName: 'Global Solutions', companyBio: 'Global Solutions offers comprehensive IT services for businesses worldwide.', companyLogo: '/main.svg' }, | ||
{ id: '3', companyEmail: '[email protected]', companyName: 'Innovatech', companyBio: 'Innovatech specializes in backend systems and cloud-based solutions.', companyLogo: '/main.svg' }, | ||
] | ||
|
||
|
||
let jobs = [ | ||
{ | ||
id: '1', | ||
|
@@ -332,6 +331,7 @@ async function seedUsers() { | |
password: hashedPassword, | ||
role: u.role || Role.USER, | ||
emailVerified: new Date(), | ||
companyId: u.companyId | ||
}, | ||
}); | ||
console.log(`User created or updated: ${u.email}`); | ||
|
@@ -344,6 +344,28 @@ async function seedUsers() { | |
console.error('Error seeding users:', error); | ||
} | ||
} | ||
async function seedCompanies() { | ||
try { | ||
await Promise.all( | ||
companies.map(async (c) => | ||
prisma.company.upsert({ | ||
where: { id: c.id }, | ||
create: { | ||
id: c.id, | ||
companyName: c.companyName, | ||
companyEmail: c.companyEmail ?? "[email protected]", | ||
companyBio: c.companyBio, | ||
companyLogo: c.companyLogo, | ||
}, | ||
update: {}, | ||
}) | ||
) | ||
); | ||
console.log('✅ Company seed completed successfully'); | ||
} catch (error) { | ||
console.error('Error seeding companies:', error); | ||
} | ||
} | ||
|
||
async function seedJobs() { | ||
try { | ||
|
@@ -405,6 +427,7 @@ async function seedJobs() { | |
} | ||
|
||
async function main() { | ||
await seedCompanies(); | ||
await seedUsers(); | ||
await seedJobs(); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
User-agent: * | ||
Allow: / | ||
Disallow: /admin/* | ||
Disallow: /manage/* | ||
|
||
Sitemap: https://job.vineet.tech/sitemap.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { getUserRecruiters } from '@/actions/user.profile.actions'; | ||
import ManageRecruiters from '@/components/ManageRecruiters'; | ||
|
||
import { options } from '@/lib/auth'; | ||
import { getServerSession } from 'next-auth'; | ||
import { redirect } from 'next/navigation'; | ||
import React from 'react'; | ||
|
||
const RecruitersPage = async () => { | ||
const server = await getServerSession(options); | ||
if (!server?.user) { | ||
redirect('/api/auth/signin'); | ||
} else if (server.user.role !== 'ADMIN') { | ||
redirect('/jobs'); | ||
} | ||
|
||
const Recruiters = await getUserRecruiters(); | ||
|
||
return <ManageRecruiters recruiters={Recruiters} />; | ||
}; | ||
|
||
export default RecruitersPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.