Skip to content

Commit

Permalink
Fix to change status in application stage process (#165)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mugisha146 authored and bahati10 committed Dec 6, 2024
1 parent afe9ae9 commit 08892ae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 68 deletions.
10 changes: 5 additions & 5 deletions src/resolvers/applicationStageResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,11 +354,11 @@ export const applicationStageResolvers: any = {
if (stageTracking) {
await Shortlisted.updateOne(
{ applicantId, status: "No action" },
{ $set: { status: "Moved" } }
{ $set: { status: "Passed" } }
);
await TraineeApplicant.updateOne(
{ _id: applicantId },
{ $set: { applicationPhase: nextStage, status: "Moved" } }
{ $set: { applicationPhase: nextStage, status: "Passed" } }
);
}

Expand Down Expand Up @@ -406,11 +406,11 @@ export const applicationStageResolvers: any = {
if (stageTracking) {
await TechnicalAssessment.updateOne(
{ applicantId, status: "No action" },
{ $set: { status: "Moved" } }
{ $set: { status: "Passed" } }
);
await TraineeApplicant.updateOne(
{ _id: applicantId },
{ $set: { applicationPhase: nextStage, status: "Moved" } }
{ $set: { applicationPhase: nextStage, status: "Passed" } }
);
}
await InterviewAssessment.create({
Expand Down Expand Up @@ -456,7 +456,7 @@ export const applicationStageResolvers: any = {
if (stageTracking) {
await InterviewAssessment.updateOne(
{ applicantId, status: "No action" },
{ $set: { status: "Moved" } }
{ $set: { status: "Passed" } }
);
}

Expand Down
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: 'beniraa@gmail.com',
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: 'testUser@gmail.com',
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: 'ben@gmail.com',
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: 'carlos@gmail.com',
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: 'nshuti@gmail.com',
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

0 comments on commit 08892ae

Please sign in to comment.