collective router update

This commit is contained in:
tmshv committed 2016-02-24 18:49:28 +03:00
1 parent d4de62d133
commit f91dfcbcdf
2 files changed
+13 -15

No files matched your search

+12 -14
View File
@@ -4,20 +4,18 @@ import db from '../core/db';
import {getCourseNameByID} from '../models/course'; import {getCourseNameByID} from '../models/course';
import team from '../models/team'; import team from '../models/team';
export default function (app) { export default function () {
app.use( return route.get('/collective', json(
route.get('/collective', json( function *() {
function *() { this.type = 'application/json';
this.type = 'application/json';
let data = yield db.c('collective').find(); let data = yield db.c('collective').find();
if (!data) { if (!data) {
this.status = 404; this.status = 404;
return; return;
}
this.body = data;
} }
))
); this.body = data;
}
))
}; };
+1 -1
View File
@@ -53,5 +53,5 @@ gallery(app);
instagram(app); instagram(app);
instagramIO(app); instagramIO(app);
documents(app); documents(app);
collective(app); app.use(collective());
app.use(error404()); app.use(error404());