Skip to content

Commit 2f49c95

Browse files
authored
Merge pull request #146 from scribd/ashby
Properly reference the jobs which are now on Ashby
2 parents d676003 + 623a948 commit 2f49c95

File tree

2 files changed

+15
-16
lines changed

2 files changed

+15
-16
lines changed

assets/js/jobs.js

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
*
66
* With that disclaimer out of the way...
77
*
8-
* This file handles the fetching of jobs from Lever such that they can be
8+
* This file handles the fetching of jobs from Lever^WAshby such that they can be
99
* dynamically inserted into different parts of the tech blog
1010
*/
1111

1212
/*
1313
* This API will return an list of departments which must then be filtered
1414
* through to find the .postings under each
1515
*/
16-
const API_URL = 'https://api.lever.co/v0/postings/scribd?group=department&mode=json'
16+
const API_URL = 'https://api.ashbyhq.com/posting-api/job-board/scribd?includeCompensation=true'
1717

1818

1919
/*
@@ -37,21 +37,20 @@ function fetchJobs() {
3737

3838
return fetch(API_URL)
3939
.then(async (response) => {
40-
const departments = await response.json();
40+
const board = await response.json();
4141
/*
4242
* Since this is the tech blog, we're only pulling a couple of
4343
* departments
4444
*/
45-
departments
46-
.filter(d => ['Engineering', 'Data Science', 'Design', 'Business Analytics', 'Product'].includes(d.title))
47-
.forEach((department) => {
48-
department.postings.forEach((posting) => {
49-
const team = posting.categories.team;
45+
board.jobs
46+
.filter(j => ['Engineering', 'Product, Design, & Analytics', 'Product'].includes(j.department))
47+
.filter(j => !j.title.toLowerCase().includes('marketing'))
48+
.forEach((job) => {
49+
const team = job.team;
5050
if (!window.jobsCache[team]) {
5151
window.jobsCache[team] = [];
5252
}
53-
window.jobsCache[team].push(posting);
54-
});
53+
window.jobsCache[team].push(job);
5554
});
5655
window.jobsFetched = true;
5756
return window.jobsCache;
@@ -98,9 +97,9 @@ function renderJobs(elem, team, randomLimit) {
9897
li.innerHTML = `
9998
<div class="card__body">
10099
<h5 class="mt-0 mb-1 clamp-2">
101-
<a href="${job.hostedUrl}" target="_blank" class="stretched-link link-text-color">${job.text}</a>
100+
<a href="${job.jobUrl}" target="_blank" class="stretched-link link-text-color">${job.title}</a>
102101
</h5>
103-
<p class="m-0 fs-md monospace text-truncate">${job.categories.location || ''}</p>
102+
<p class="m-0 fs-md monospace text-truncate">${job.location || ''}</p>
104103
</div>
105104
`;
106105
elem.appendChild(li);

careers.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,14 +159,14 @@ <h3 class="mb-3">${team}
159159
li.innerHTML = `
160160
<div class="action-cell__body">
161161
<h5 class="mb-1">
162-
<a href="${job.hostedUrl}" target="_blank" class="action-cell__link">
163-
${job.text}
162+
<a href="${job.jobUrl}" target="_blank" class="action-cell__link">
163+
${job.title}
164164
<svg class="hidden-md-up fs-md svg-icon"><use xlink:href="{{ '/assets/images/icons/icon-sprite.svg#arrow-external' | relative_url }}"></use></svg>
165165
</a>
166166
</h5>
167-
<p class="mb-0 fs-md text-truncate text-muted monospace">${job.categories.location || ''}</p>
167+
<p class="mb-0 fs-md text-truncate text-muted monospace">${job.location || ''}</p>
168168
</div>
169-
<a href="${job.hostedUrl}" target="_blank" class="hidden-md-down btn btn-primary btn-icon-external" tabindex="-1" aria-hidden="true">View Job
169+
<a href="${job.jobUrl}" target="_blank" class="hidden-md-down btn btn-primary btn-icon-external" tabindex="-1" aria-hidden="true">View Job
170170
<svg class="svg-icon"><use xlink:href="{{ '/assets/images/icons/icon-sprite.svg#arrow-external' | relative_url }}"></use></svg>
171171
</a>
172172
`;

0 commit comments

Comments
 (0)