Answer the question
In order to leave comments, you need to log in
Render requests with mongoose to koa?
I can’t decide how to render requests, I can display clean requests in ctx.body but I can’t output them in rendering
router.get('/user', async(ctx) => {
try {
let orders = Order.find((err, doc) => {
return doc;
});
await ctx.render('user', {
title: 'Главнвя страница',
username: ctx.state.user,
order: orders
});
} catch (err) {
await console.log(err);
}
});
mixin gridView()
each val in order
tr
td=val.orderId
td=val.time
td=val.description
td=val.tag
td=val.shipping
td=val.juid
td=val.status
Answer the question
In order to leave comments, you need to log in
router
.get('/user', async(ctx) => {
auth(ctx);
try {
let orders = await Order.find((err, doc) => {
return doc;
});
return ctx.render('user', {
title: 'Главнвя страница',
username: ctx.state.user,
order: orders
});
} catch(err){
await console.log(err);
}
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question