Skip to content

Commit 9c91a24

Browse files
committed
Add hire stage to gig apply
1 parent 3b7f58c commit 9c91a24

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/server/services/recruitCRM.js

+23
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,29 @@ export default class RecruitCRMService {
288288
errObj,
289289
});
290290
}
291+
// Set hired-stage
292+
const hireStageResponse = await fetch(`${this.private.baseUrl}/v1/candidates/${candidateData.slug}/hiring-stages/${id}`, {
293+
method: 'POST',
294+
headers: {
295+
'Content-Type': 'application/json',
296+
Authorization: this.private.authorization,
297+
},
298+
body: JSON.stringify({
299+
candidate_slug: candidateData.slug,
300+
job_slug: id,
301+
status_id: '65183',
302+
}),
303+
});
304+
if (hireStageResponse.status >= 400) {
305+
return res.send({
306+
error: true,
307+
status: hireStageResponse.status,
308+
url: `$${this.private.baseUrl}/v1/candidates/${candidateData.slug}/hiring-stages/${id}`,
309+
form,
310+
errObj: await hireStageResponse.json(),
311+
});
312+
}
313+
// respond to API call
291314
const data = await applyResponse.json();
292315
return res.send(data);
293316
} catch (err) {

0 commit comments

Comments
 (0)