css and some nav
This commit is contained in:
1 parent
a8e5e5d7cd
commit
9a42c290ae
10 files changed
+273
-195
No files matched your search
+12
-12
@@ -22,17 +22,17 @@ export default function createApi(log: Log, pg: Pg, discogs) {
|
||||
const app = new koa();
|
||||
const server = http.createServer(app.callback());
|
||||
|
||||
// app.use(async (ctx, next) => {
|
||||
// try {
|
||||
// await next();
|
||||
// } catch (err) {
|
||||
// log.error(err);
|
||||
// ctx.status = err.statusCode || err.status || 500;
|
||||
// ctx.body = {
|
||||
// message: err.message
|
||||
// };
|
||||
// }
|
||||
// });
|
||||
app.use(async (ctx, next) => {
|
||||
try {
|
||||
await next();
|
||||
} catch (err) {
|
||||
log.error(err);
|
||||
ctx.status = err.statusCode || err.status || 500;
|
||||
ctx.body = {
|
||||
error: err.message
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
const router = koaRouter();
|
||||
|
||||
@@ -128,7 +128,7 @@ export default function createApi(log: Log, pg: Pg, discogs) {
|
||||
const { id } = ctx.request.params;
|
||||
const user = await pg.userFindId(id);
|
||||
|
||||
// if (!user) return ctx.response.status = 404;
|
||||
ctx.assert(user, 404, `user ${id} not found`);
|
||||
|
||||
const bundles = (await getBundles())
|
||||
.map(b => {
|
||||
|
||||
Reference in new issue
Block a user