-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New Components - smartymeet #12701
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
New Components - smartymeet #12701
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
import smartymeet from "../../smartymeet.app.mjs"; | ||
|
||
export default { | ||
key: "smartymeet-create-candidate", | ||
name: "Create Candidate", | ||
description: "Creates a new candidate profile in SmartyMeet. [See the documentation](https://docs.smartymeet.com/category/smartymeet-versioned-api)", | ||
version: "0.0.{{ts}}", | ||
type: "action", | ||
props: { | ||
smartymeet, | ||
name: { | ||
type: "string", | ||
label: "Name", | ||
description: "The candidate's name.", | ||
}, | ||
status: { | ||
type: "string", | ||
label: "Status", | ||
description: "The candidate's status.", | ||
options: [ | ||
"active", | ||
"rejected", | ||
"archived", | ||
"closed", | ||
], | ||
optional: true, | ||
}, | ||
phone: { | ||
type: "string", | ||
label: "Phone", | ||
description: "The candidate's phone.", | ||
optional: true, | ||
}, | ||
email: { | ||
type: "string", | ||
label: "Email", | ||
description: "The candidate's email.", | ||
optional: true, | ||
}, | ||
/* talentId: { | ||
propDefinition: [ | ||
smartymeet, | ||
"talentId", | ||
], | ||
}, */ | ||
jobId: { | ||
propDefinition: [ | ||
smartymeet, | ||
"jobId", | ||
], | ||
}, | ||
}, | ||
async run({ $ }) { | ||
const response = await this.smartymeet.createCandidate({ | ||
$, | ||
data: { | ||
type: "candidates", | ||
attributes: { | ||
name: this.name, | ||
status: this.status, | ||
phone: this.phone, | ||
email: this.email, | ||
}, | ||
relationships: { | ||
/* talents: { | ||
type: "talents", | ||
id: this.talentId, | ||
}, */ | ||
jobs: { | ||
type: "jobs", | ||
id: this.jobId, | ||
}, | ||
}, | ||
}, | ||
}); | ||
|
||
$.export("$summary", `Successfully created candidate with Id: ${response.data.id}`); | ||
return response; | ||
}, | ||
}; | ||
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,140 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
import { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CURRENCY_OPTIONS, EDUCATION_OPTIONS, EXPERIENCE_OPTIONS, INDUSTRY_OPTIONS, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
JOB_FUNCTION_OPTIONS, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
JOB_TYPE_OPTIONS, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
STATUS_OPTIONS, WORKPLACE_OPTIONS, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} from "../../common/constants.mjs"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
import { parseObject } from "../../common/utils.mjs"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
import smartymeet from "../../smartymeet.app.mjs"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
export default { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
key: "smartymeet-create-job", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
name: "Create Job", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
description: "Generates a new job in the SmartyMeet system. [See the documentation](https://docs.smartymeet.com/smartymeet_versioned/jobs)", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
version: "0.0.{{ts}}", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
type: "action", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
props: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
smartymeet, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
title: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
type: "string", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
label: "Title", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
description: "The job's title.", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
optional: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
status: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
type: "string", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
label: "Status", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
description: "The Job's status.", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
options: STATUS_OPTIONS, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
optional: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
candidates: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
type: "integer", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
label: "Candidates", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
description: "The candidates' quantity.", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
optional: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
workplace: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
type: "string", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
label: "workplace", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
description: "workplace", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
options: WORKPLACE_OPTIONS, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
optional: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
description: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
type: "string", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
label: "Description", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
description: "The job's description.", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
optional: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
industry: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
type: "string", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
label: "Industry", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
description: "The company industry.", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
options: INDUSTRY_OPTIONS, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
optional: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
jobFunction: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
type: "string", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
label: "Job Function", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
description: "The job function title.", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
options: JOB_FUNCTION_OPTIONS, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
optional: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
jobType: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
type: "string", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
label: "Job Type", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
description: "The employment type.", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
options: JOB_TYPE_OPTIONS, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
optional: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
experience: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
type: "string", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
label: "Experience", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
description: "The expected candidate's experience.", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
options: EXPERIENCE_OPTIONS, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
optional: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
education: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
type: "string", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
label: "Education", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
description: "The expected candidate's education.", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
options: EDUCATION_OPTIONS, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
optional: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
salaryFrom: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
type: "string", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
label: "Salary From", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
description: "The minimum salary amount.", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
optional: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
salaryTo: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
type: "string", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
label: "Salary To", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
description: "The maximum salary amount.", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
optional: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
currency: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
type: "string", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
label: "Currency", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
description: "The salary currency.", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
options: CURRENCY_OPTIONS, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
optional: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
keywords: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
type: "string[]", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
label: "keywords", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
description: "keywords", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
optional: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
async run({ $ }) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const response = await this.smartymeet.createJob({ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
$, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
data: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
type: "jobs", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
attributes: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
title: this.title, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
status: this.status, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
candidates: this.candidates, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
workplace: this.workplace, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
description: this.description, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
industry: this.industry, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
jobFunction: this.jobFunction, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
jobType: this.jobType, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
experience: this.experience, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
education: this.education, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
salary: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
from: this.salaryFrom, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
to: this.salaryTo, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
currency: this.currency, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
keywords: parseObject(this.keywords), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
$.export("$summary", `Successfully created job with title "${this.jobTitle}"`); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
return response; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+111
to
+139
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix the summary message in the run function. The summary message should use - $.export("$summary", `Successfully created job with title "${this.jobTitle}"`);
+ $.export("$summary", `Successfully created job with title "${this.title}"`); Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}; |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,41 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
import smartymeet from "../../smartymeet.app.mjs"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
export default { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
key: "smartymeet-get-job-candidate-analysis", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
name: "Get Job Candidate Analysis", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
description: "Retrieves the analysis for a job candidate within SmartyMeet. [See the documentation](https://docs.smartymeet.com)", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
version: "0.0.1", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
type: "action", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
props: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
smartymeet, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
jobId: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
propDefinition: [ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
smartymeet, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"jobId", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
candidateId: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
propDefinition: [ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
smartymeet, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"candidateId", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
({ jobId }) => ({ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
jobId, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
async run({ $ }) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const response = await this.smartymeet.listCandidates({ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
$, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
jobId: this.jobId, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const candidate = response.find((candidate) => `${candidate.shardId}:${candidate.contactId}` === this.candidateId); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (candidate) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
$.export("$summary", `Successfully retrieved analysis for candidate with Id: ${this.candidateId}`); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
return candidate.jobs[0]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
$.export("$summary", `Candidate with Id: ${this.candidateId} not found.`); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+1
to
+41
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. LGTM! Consider improving the candidate search and error handling. The action implementation is correct. However, consider the following improvements:
async run({ $ }) {
const response = await this.smartymeet.listCandidates({
$,
jobId: this.jobId,
});
if (!response || response.length === 0) {
$.export("$summary", `No candidates found for job Id: ${this.jobId}`);
return;
}
const candidate = response.find((c) => `${c.shardId}:${c.contactId}` === this.candidateId);
if (candidate) {
$.export("$summary", `Successfully retrieved analysis for candidate with Id: ${this.candidateId}`);
return candidate.jobs[0];
}
$.export("$summary", `Candidate with Id: ${this.candidateId} not found.`);
} Committable suggestion
Suggested change
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Address commented-out code and improve error handling.
The action implementation is correct. However, consider the following improvements:
talentId
.Committable suggestion