5
5
*
6
6
* With that disclaimer out of the way...
7
7
*
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
9
9
* dynamically inserted into different parts of the tech blog
10
10
*/
11
11
12
12
/*
13
13
* This API will return an list of departments which must then be filtered
14
14
* through to find the .postings under each
15
15
*/
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 '
17
17
18
18
19
19
/*
@@ -37,21 +37,20 @@ function fetchJobs() {
37
37
38
38
return fetch ( API_URL )
39
39
. then ( async ( response ) => {
40
- const departments = await response . json ( ) ;
40
+ const board = await response . json ( ) ;
41
41
/*
42
42
* Since this is the tech blog, we're only pulling a couple of
43
43
* departments
44
44
*/
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 ;
50
50
if ( ! window . jobsCache [ team ] ) {
51
51
window . jobsCache [ team ] = [ ] ;
52
52
}
53
- window . jobsCache [ team ] . push ( posting ) ;
54
- } ) ;
53
+ window . jobsCache [ team ] . push ( job ) ;
55
54
} ) ;
56
55
window . jobsFetched = true ;
57
56
return window . jobsCache ;
@@ -98,9 +97,9 @@ function renderJobs(elem, team, randomLimit) {
98
97
li . innerHTML = `
99
98
<div class="card__body">
100
99
<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>
102
101
</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>
104
103
</div>
105
104
` ;
106
105
elem . appendChild ( li ) ;
0 commit comments