+ collective route
This commit is contained in:
1 parent
54a6bddf90
commit
5244beecf8
1 file changed
+23
@@ -0,0 +1,23 @@
|
||||
import route from 'koa-route';
|
||||
import {json} from './';
|
||||
import db from '../core/db';
|
||||
import {getCourseNameByID} from '../models/course';
|
||||
import team from '../models/team';
|
||||
|
||||
export default function (app) {
|
||||
app.use(
|
||||
route.get('/collective', json(
|
||||
function *() {
|
||||
this.type = 'application/json';
|
||||
|
||||
let data = yield db.c('collective').find();
|
||||
if (!data) {
|
||||
this.status = 404;
|
||||
return;
|
||||
}
|
||||
|
||||
this.body = data;
|
||||
}
|
||||
))
|
||||
);
|
||||
};
|
||||
Reference in new issue
Block a user