File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,20 +41,38 @@ router.post(
4141 '/create' ,
4242 authenticateJWT ,
4343 validateRequest ( createProofSchema ) ,
44- locationProofController . createProof
44+ async ( req : express . Request , res : express . Response , next : express . NextFunction ) : Promise < void > => {
45+ try {
46+ await locationProofController . createProof ( req , res , next ) ;
47+ } catch ( error ) {
48+ next ( error ) ;
49+ }
50+ }
4551) ;
4652
4753router . get (
48- '/user' ,
54+ '/user' ,
4955 authenticateJWT ,
50- locationProofController . getProofsByUser
56+ async ( req : express . Request , res : express . Response , next : express . NextFunction ) : Promise < void > => {
57+ try {
58+ await locationProofController . getProofsByUser ( req , res , next ) ;
59+ } catch ( error ) {
60+ next ( error ) ;
61+ }
62+ }
5163) ;
5264
5365router . post (
54- '/nearby' ,
66+ '/nearby' ,
5567 authenticateJWT ,
5668 validateRequest ( nearbyProofsSchema ) ,
57- locationProofController . findValidProofsNearby
69+ async ( req : express . Request , res : express . Response , next : express . NextFunction ) : Promise < void > => {
70+ try {
71+ await locationProofController . findValidProofsNearby ( req , res , next ) ;
72+ } catch ( error ) {
73+ next ( error ) ;
74+ }
75+ }
5876) ;
5977
6078export default router ;
You can’t perform that action at this time.
0 commit comments