Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/admin domains #124

Merged
merged 5 commits into from
Nov 24, 2021
Merged

Feat/admin domains #124

merged 5 commits into from
Nov 24, 2021

Conversation

shadowgate15
Copy link
Contributor

No description provided.

app/controllers/web/admin/domains.js Outdated Show resolved Hide resolved
app/views/admin/domains/_table.pug Outdated Show resolved Hide resolved
});

// this will assign rendered html to ctx.body
await ctx.render('admin/domains/_table', {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an anti-pattern and bad practice for code readability to assume users know that calling ctx.render assigns to ctx.body.

Instead you should write it out here as ctx.body = await ctx.render(...).

I think all we'd have to do is add a return html here to koa-views to support this @ https://github.com/queckezz/koa-views/blob/master/src/index.js#L72

I'm an author on koa-views on npm I think so once you submit a PR I can merge and release with semver major bump.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will also need to change this everywhere else we do this practice, as it's an anti-pattern to write in a way that's not readable to newbies.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

queckezz/koa-views#161

waiting on this to be accepted.

Copy link
Contributor

@niftylettuce niftylettuce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments, thank you!

@niftylettuce niftylettuce merged commit 6a10c40 into master Nov 24, 2021
@niftylettuce niftylettuce deleted the feat/admin-domains branch November 24, 2021 23:19
titanism pushed a commit that referenced this pull request Jul 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants