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

clean code #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

clean code #1

wants to merge 1 commit into from

Conversation

bayungrh
Copy link

No description provided.

try {
return await this.req.get(eventListUrl, {
return this.req.get(eventListUrl, {
Copy link
Member

Choose a reason for hiding this comment

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

the catch inside this function will be useless then?

I'm putting out catch in this function to avoid polluting the caller with handling got http error

const {
uploadFile
} = require('./libraries/bucketManager');
const { uploadFile } = require('./libraries/bucketManager');
Copy link
Member

Choose a reason for hiding this comment

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

which clean code standart are we using? why are you modifiying some into one line but leaving out the others?

@@ -40,7 +38,11 @@ app.post('/', async (req, res, next) => {
} = req.body;

await login.login(email, password);
const pages = await Promise.all([login.getTicketList(), login.getEventlist(), login.getHandshakeList()]);
const pages = await Promise.all([
Copy link
Member

Choose a reason for hiding this comment

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

agree with this, should've spanned multiple lines

}

if (handshakes.length === 0) {
} else {
Copy link
Member

Choose a reason for hiding this comment

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

else will prone to error if we have unhandled case within the ifs, in this case, we know every possible case, so it's okay.

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