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 ) ;
0 commit comments