brianc / node-postgres-docs

Documentation for node-postgres
https://node-postgres.com
MIT License
98 stars 94 forks source link

missing 'return' after execute the query #122

Closed stevenchu03 closed 3 years ago

stevenchu03 commented 3 years ago

this code missing return should be like in this page https://node-postgres.com/guides/project-structure

netlify[bot] commented 3 years ago

Hey! A preview of the changes is deployed on netlify to take a look at! :)

Built with commit 26f2e07cea97992a150f50cfe91c0715b2b59146

https://deploy-preview-122--hopeful-clarke-f36d36.netlify.app

stevenchu03 commented 3 years ago

No, that’s an expression-bodied arrow function. It’s already correct, and this change would make it a syntax error.

Sorry, I didn't notice it. Thanks for clarify 🙏

igolskyi commented 3 years ago

should be like in this page https://node-postgres.com/guides/project-structure

There is, would make also short syntax

module.exports = {
  query: (text, params, callback) => pool.query(text, params, callback),
}
stevenchu03 commented 3 years ago

should be like in this page https://node-postgres.com/guides/project-structure

There is, would make also short syntax

module.exports = {
  query: (text, params, callback) => pool.query(text, params, callback),
}

Hi Igolskyi, thanks for your explanation. Last night, I learned express js with PG. and I didn't notice. I code like this:

module.exports = {
   query: (text, params) => {return pool.query(text,params)}
}

I will be more careful to open PR 🙏