Skip to content

Commit 48dd665

Browse files
committed
fix: switch await ctx.render to return ctx.render
1 parent 2dad477 commit 48dd665

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

template/app/controllers/web/admin/users.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ async function list(ctx) {
1717

1818
const pageCount = Math.ceil(itemCount / ctx.query.limit);
1919

20-
await ctx.render('admin/users', {
20+
return ctx.render('admin/users', {
2121
users,
2222
pageCount,
2323
itemCount,
@@ -28,7 +28,7 @@ async function list(ctx) {
2828
async function retrieve(ctx) {
2929
ctx.state.result = await Users.findById(ctx.params.id);
3030
if (!ctx.state.result) throw ctx.translateError('INVALID_USER');
31-
await ctx.render('admin/users/retrieve');
31+
return ctx.render('admin/users/retrieve');
3232
}
3333

3434
async function update(ctx) {

template/app/controllers/web/auth.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ async function registerOrLogin(ctx) {
8686
ctx.state.verb =
8787
ctx.pathWithoutLocale === '/register' ? 'sign up' : 'sign in';
8888

89-
await ctx.render('register-or-login');
89+
return ctx.render('register-or-login');
9090
}
9191

9292
async function homeOrDashboard(ctx) {
@@ -104,7 +104,8 @@ async function homeOrDashboard(ctx) {
104104
),
105105
description: sanitize(ctx.request.t(config.pkg.description))
106106
};
107-
await ctx.render('home');
107+
108+
return ctx.render('home');
108109
}
109110

110111
async function login(ctx, next) {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
async function keys(ctx) {
22
// this is like a migration, it will automatically add token + keys if needed
33
await ctx.state.user.save();
4-
await ctx.render('otp/setup');
4+
return ctx.render('otp/setup');
55
}
66

77
module.exports = keys;

0 commit comments

Comments
 (0)