collective router update
This commit is contained in:
1 parent
d4de62d133
commit
f91dfcbcdf
2 files changed
+13
-15
No files matched your search
+12
-14
@@ -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
@@ -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());
|
||||||
Reference in new issue
Block a user