File tree Expand file tree Collapse file tree 2 files changed +9
-11
lines changed
Expand file tree Collapse file tree 2 files changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ const catchAsync = require('../utils/catchAsync');
66
77const auth = require ( '../controllers/auth' ) ;
88
9- const { isLoggedIn} = require ( '../middleware' )
9+ const { isLoggedIn } = require ( '../middleware' )
1010
1111router . post ( '/register' , catchAsync ( auth . register ) ) ;
1212
Original file line number Diff line number Diff line change @@ -9,17 +9,15 @@ const catchAsync = require('../utils/catchAsync');
99
1010const notes = require ( '../controllers/notes' )
1111
12- const { isLoggedIn, validateNotes } = require ( '../middleware' )
12+ const { isLoggedIn, validateNotes } = require ( '../middleware' ) ;
1313
14- router . post ( '/' , validateNotes , catchAsync ( notes . newNote ) ) ;
14+ router . route ( '/' )
15+ . post ( validateNotes , catchAsync ( notes . newNote ) )
16+ . get ( isLoggedIn , catchAsync ( notes . allNote ) )
1517
16- router . get ( "/" , isLoggedIn , catchAsync ( notes . allNote ) ) ;
17-
18-
19- router . get ( '/:id' , isLoggedIn , catchAsync ( notes . oneNote ) ) ;
20-
21- router . put ( '/:id' , isLoggedIn , validateNotes , catchAsync ( notes . editnote ) ) ;
22-
23- router . delete ( '/:id' , isLoggedIn , catchAsync ( notes . deleteNote ) )
18+ router . route ( '/:id' )
19+ . get ( isLoggedIn , catchAsync ( notes . oneNote ) )
20+ . put ( isLoggedIn , validateNotes , catchAsync ( notes . editnote ) )
21+ . delete ( isLoggedIn , catchAsync ( notes . deleteNote ) )
2422
2523module . exports = router ;
You can’t perform that action at this time.
0 commit comments