Skip to content

Commit

Permalink
fix seeds
Browse files Browse the repository at this point in the history
  • Loading branch information
Mugisha146 committed Dec 2, 2024
1 parent dac4202 commit 1c0354c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 107 deletions.
64 changes: 1 addition & 63 deletions src/seeders/DelTrainee.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,69 +10,7 @@ const seedDeleteTrainee = async () => {
return;
}

const deleteTrainee = [
{
email: '[email protected]',
firstName: 'Ben',
lastName: 'iraa',
deleted_at: false,
cycle_id: cycle._id,
coverLetterUrl: "http://example.com/coverLetter.pdf",
idDocumentUrl: "http://example.com/idDocument.pdf",
resumeUrl: "http://example.com/resume.pdf"

},
{
email: '[email protected]',
firstName: 'Test',
lastName: 'user',
deleted_at: false,
cycle_id: cycle._id,
coverLetterUrl: "http://example.com/coverLetter.pdf",
idDocumentUrl: "http://example.com/idDocument.pdf",
resumeUrl: "http://example.com/resume.pdf"


},
{
email: '[email protected]',
firstName: 'iradukunda',
lastName: 'benjamin',
deleted_at: false,
cycle_id: cycle._id,
coverLetterUrl: "http://example.com/coverLetter.pdf",
idDocumentUrl: "http://example.com/idDocument.pdf",
resumeUrl: "http://example.com/resume.pdf"


},
{
email: '[email protected]',
firstName: 'carlos',
lastName: 'Bz',
deleted_at: false,
cycle_id: cycle._id,
coverLetterUrl: "http://example.com/coverLetter.pdf",
idDocumentUrl: "http://example.com/idDocument.pdf",
resumeUrl: "http://example.com/resume.pdf"


},
{
email: '[email protected]',
firstName: 'blaise',
lastName: 'k',
deleted_at: false,
cycle_id: cycle._id,
coverLetterUrl: "http://example.com/coverLetter.pdf",
idDocumentUrl: "http://example.com/idDocument.pdf",
resumeUrl: "http://example.com/resume.pdf"


},
];
await TraineeApplicant.deleteMany({ deleteTrainee });
await TraineeApplicant.insertMany(deleteTrainee);
await TraineeApplicant.deleteMany({});
await traineEAttributes.deleteMany({});
return null;
}
Expand Down
45 changes: 1 addition & 44 deletions src/seeders/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,6 @@ const seedUsers = async () => {
}

const users = [
{
firstname: "John",
lastname: "Trainee",
email: "[email protected]",
password: await BcryptUtil.hash("password123"),
role: traineeRole._id,
country: "Rwanda",
code: "+250",
telephone: "0788888887",
isActive: true,
gender: "male",
cohort: cohort._id,
applicationPhase: "Admitted",
isVerified: true,
},
{
firstname: "Super",
lastname: "Admin",
Expand All @@ -51,35 +36,7 @@ const seedUsers = async () => {
isActive: true,
gender: "female",
isVerified: true,
},
{
firstname: "Manzi",
lastname: "Jean",
email: "[email protected]",
password: await BcryptUtil.hash("password123"),
role: applicantRole._id,
country: "Rwanda",
code: "+250",
telephone: "0788888889",
isActive: true,
gender: "male",
applicationPhase: "Applied",
cohort: cohort._id,
isVerified: true,
},
{
firstname: "Jane",
lastname: "Doe",
email: "[email protected]",
password: await BcryptUtil.hash("password123"),
role: applicantRole._id,
country: "Rwanda",
code: "+250",
telephone: "0788888888",
isActive: true,
isVerified: true,
gender: "male",
},
}
];
await LoggedUserModel.deleteMany({ users });
await LoggedUserModel.insertMany(users);
Expand Down

0 comments on commit 1c0354c

Please sign in to comment.