Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit df1360e

Browse files
add active jobs
1 parent e29ef4f commit df1360e

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

src/api/app-constants.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ const MY_GIGS_JOB_STATUS = {
3030
};
3131

3232
const JOB_APPLICATION_STATUS_MAPPER = {
33+
active_jobs: {
34+
statuses: [MY_GIGS_JOB_STATUS.PLACED],
35+
},
3336
open_jobs: {
3437
statuses: [
3538
MY_GIGS_JOB_STATUS.APPLIED,
@@ -39,7 +42,6 @@ const JOB_APPLICATION_STATUS_MAPPER = {
3942
MY_GIGS_JOB_STATUS.INTERVIEW,
4043
MY_GIGS_JOB_STATUS.SELECTED,
4144
MY_GIGS_JOB_STATUS.OFFERED,
42-
MY_GIGS_JOB_STATUS.PLACED,
4345
],
4446
},
4547
completed_jobs: {

src/api/docs/swagger.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ paths:
5454
required: false
5555
schema:
5656
type: string
57-
enum: ["open_jobs", "completed_jobs", "archived_jobs"]
57+
enum: ["active_jobs", "open_jobs", "completed_jobs", "archived_jobs"]
5858
responses:
5959
"200":
6060
description: OK

src/api/services/JobApplicationService.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ async function getMyJobApplications(currentUser, criteria) {
5353
}
5454
let jcResult = jobCandidates.result;
5555
// handle placed status for completed_jobs, archived_jobs query
56-
if (status && status != "archived_jobs") {
56+
if (status && (status == "active_jobs" || status == "completed_jobs")) {
5757
await helper.handlePlacedJobCandidates(jobCandidates.result, userId);
5858
if (status == "completed_jobs") {
5959
jcResult = jobCandidates.result.filter(
6060
(item) => item.status == "completed"
6161
);
6262
}
63-
if (status == "open_jobs") {
63+
if (status == "active_jobs") {
6464
jcResult = jobCandidates.result.filter(
6565
(item) => item.status != "completed"
6666
);
@@ -113,6 +113,7 @@ getMyJobApplications.schema = Joi.object()
113113
sortBy: Joi.string().valid("id", "status").default("id"),
114114
sortOrder: Joi.string().valid("desc", "asc").default("desc"),
115115
status: Joi.string().valid(
116+
"active_jobs",
116117
"open_jobs",
117118
"completed_jobs",
118119
"archived_jobs"

0 commit comments

Comments
 (0)