-
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.
* fix: deleted jobs were showing * feat: jobs management page done * feat: added new ui for the payment and recruiters * fix: minor changes * fix:fixed responsiveness * fix:minor fix * feat:removed payment * fix:removed payments * feat:added filters * feat:added recruiters * fix:minor change * fix:minor changes * fix:filter fixed * fix: fixed responsiveness * fix:minor change
- Loading branch information
1 parent
5e66c62
commit 139175f
Showing
19 changed files
with
561 additions
and
130 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,9 +14,21 @@ const prisma = new PrismaClient(); | |
const users = [ | ||
{ id: '1', name: 'Jack', email: '[email protected]' }, | ||
{ id: '2', name: 'Admin', email: '[email protected]', role: Role.ADMIN, onBoard: true }, | ||
{ id: '3', name: 'Hr', email: '[email protected]', role: Role.HR }, | ||
{ 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', | ||
|
@@ -328,6 +340,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}`); | ||
|
@@ -340,6 +353,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 { | ||
|
@@ -401,6 +436,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
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
Oops, something went wrong.