Fix sitemap, remove jobs remnants

This commit is contained in:
Logan Tegman
2016-10-06 21:54:54 -07:00
parent 9581beb05e
commit 2762238c8d
7 changed files with 43 additions and 40 deletions

View File

@@ -32,28 +32,24 @@ export default function sitemapRouter(app) {
const router = app.loopback.Router();
const challenges$ = getCachedObservable(app, 'Challenge', 'dashedName');
const stories$ = getCachedObservable(app, 'Story', 'storyLink', dasherize);
const jobs$ = getCachedObservable(app, 'Job', 'id');
function sitemap(req, res, next) {
const now = moment(new Date()).format('YYYY-MM-DD');
return Observable.combineLatest(
challenges$,
stories$,
jobs$,
(
challenges,
stories,
jobs
) => ({ challenges, stories, jobs })
) => ({ challenges, stories })
)
.subscribe(
({ challenges, stories, jobs }) => {
({ challenges, stories }) => {
res.header('Content-Type', 'application/xml');
res.render('resources/sitemap', {
appUrl,
now,
challenges,
stories,
jobs
stories
});
},
next