-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
pr05 Typescript Migration #11: Migrate server/routes folder #3643
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
base: develop
Are you sure you want to change the base?
pr05 Typescript Migration #11: Migrate server/routes folder #3643
Conversation
…exports, no-verify
…t-exports, no-verify
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great, just a few small comments!!!
server/routes/user.routes.ts
Outdated
import isAuthenticated from '../utils/isAuthenticated'; | ||
|
||
const router = new Router(); | ||
export const router = Router(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this export needed if you export default on it later?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed!
passport.authenticate( | ||
service, | ||
{ failureRedirect: '/login' }, | ||
(err: any, user: any) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small nit but are there better types for these other than any? something from passport's types?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to find an error
and user
type from the passport @types, but I think they declare User
as {}
, and use err: any
I think when I migrate the User
model, I can import it and use it, but error might just stay as any
@khanniie I updated to address some feedback, so might need a re-review when you're ready! |
pr05 Typescript Migration 11: Migrate the server/routes folder
Should be reviewed after #3636
Changes:
I have verified that this pull request:
npm run lint
)npm run test
)develop
branch.Fixes #123