koa-oauth-server icon indicating copy to clipboard operation
koa-oauth-server copied to clipboard

Update model.js

Open vitaly-t opened this issue 9 years ago • 3 comments

your example was broken in so many places... I tried to fix it, following the logic I saw there, but the last one cannot even be fixed, its a contradiction - you return nothing from the query, and trying to process the result...

vitaly-t avatar Mar 02 '16 21:03 vitaly-t

Also, returning things like:

return users.length ? users[0] : false;

is generally a bad idea.

vitaly-t avatar Mar 02 '16 21:03 vitaly-t

Missed one thing, the last:

yield pg.none

should also become

yield db.none

vitaly-t avatar Mar 02 '16 21:03 vitaly-t

Thanks for the PR! I'll take a look at it during the weekend.

ruimarinho avatar Mar 03 '16 00:03 ruimarinho