@@ -64,7 +64,7 @@ photoRouter.get(
6464
6565photoRouter . post (
6666 '/search' ,
67- [ body ( 'page' ) . isInt ( ) . default ( 1 ) ] ,
67+ [ body ( 'page' ) . isUUID ( ) . default ( 1 ) ] ,
6868 async ( req : Request , res : Response ) => {
6969 const { query, sort, page } = req . body ;
7070
@@ -82,7 +82,7 @@ photoRouter.post(
8282 }
8383) ;
8484
85- photoRouter . get ( '/:id' , [ check ( 'id' ) . notEmpty ( ) . isInt ( ) ] , async ( req : Request , res : Response ) => {
85+ photoRouter . get ( '/:id' , [ check ( 'id' ) . notEmpty ( ) . isUUID ( ) ] , async ( req : Request , res : Response ) => {
8686 const errors = validationResult ( req ) ;
8787
8888 if ( ! errors . isEmpty ( ) ) {
@@ -104,7 +104,7 @@ photoRouter.get('/:id', [check('id').notEmpty().isInt()], async (req: Request, r
104104
105105photoRouter . get (
106106 '/:id/file' ,
107- [ check ( 'id' ) . notEmpty ( ) . isInt ( ) ] ,
107+ [ check ( 'id' ) . notEmpty ( ) . isUUID ( ) ] ,
108108 async ( req : Request , res : Response ) => {
109109 const errors = validationResult ( req ) ;
110110
@@ -131,7 +131,7 @@ photoRouter.get(
131131
132132photoRouter . get (
133133 '/:id/file/download' ,
134- [ check ( 'id' ) . notEmpty ( ) . isInt ( ) ] ,
134+ [ check ( 'id' ) . notEmpty ( ) . isUUID ( ) ] ,
135135 async ( req : Request , res : Response ) => {
136136 const errors = validationResult ( req ) ;
137137
@@ -157,7 +157,7 @@ photoRouter.get(
157157
158158photoRouter . get (
159159 '/:id/thumbfile' ,
160- [ check ( 'id' ) . notEmpty ( ) . isInt ( ) ] ,
160+ [ check ( 'id' ) . notEmpty ( ) . isUUID ( ) ] ,
161161 async ( req : Request , res : Response ) => {
162162 const errors = validationResult ( req ) ;
163163
@@ -184,7 +184,7 @@ photoRouter.get(
184184
185185photoRouter . get (
186186 '/:id/file/thumbnail' ,
187- [ check ( 'id' ) . notEmpty ( ) . isInt ( ) ] ,
187+ [ check ( 'id' ) . notEmpty ( ) . isUUID ( ) ] ,
188188 async ( req : Request , res : Response ) => {
189189 const errors = validationResult ( req ) ;
190190
@@ -330,7 +330,7 @@ photoRouter.put(
330330photoRouter . put (
331331 '/:id/file' ,
332332 multer ( ) . single ( 'file' ) ,
333- [ check ( 'id' ) . notEmpty ( ) . isInt ( ) ] ,
333+ [ check ( 'id' ) . notEmpty ( ) . isUUID ( ) ] ,
334334 async ( req : Request , res : Response ) => {
335335 const errors = validationResult ( req ) ;
336336
@@ -351,7 +351,7 @@ photoRouter.put(
351351photoRouter . post (
352352 '/saved-filter' ,
353353 [
354- body ( 'userId' ) . notEmpty ( ) . isInt ( ) ,
354+ body ( 'userId' ) . notEmpty ( ) . isUUID ( ) ,
355355 body ( 'name' ) . notEmpty ( ) . bail ( ) . isString ( ) ,
356356 body ( 'resultType' ) . notEmpty ( ) . bail ( ) . isString ( ) ,
357357 body ( 'value' ) . notEmpty ( ) . bail ( ) . isString ( ) ,
@@ -378,7 +378,7 @@ photoRouter.post(
378378
379379photoRouter . delete (
380380 '/saved-filter/:id' ,
381- [ check ( 'id' ) . isInt ( ) . notEmpty ( ) ] ,
381+ [ check ( 'id' ) . isUUID ( ) . notEmpty ( ) ] ,
382382 async ( req : Request , res : Response ) => {
383383 const errors = validationResult ( req ) ;
384384
@@ -394,7 +394,7 @@ photoRouter.delete(
394394
395395photoRouter . get (
396396 '/saved-filter/user/:id' ,
397- [ check ( 'id' ) . notEmpty ( ) . isInt ( ) ] ,
397+ [ check ( 'id' ) . notEmpty ( ) . isUUID ( ) ] ,
398398 async ( req : Request , res : Response ) => {
399399 const errors = validationResult ( req ) ;
400400
@@ -417,7 +417,7 @@ photoRouter.get(
417417// Get all site records associated with photo
418418photoRouter . get (
419419 '/:id/place' ,
420- [ check ( 'id' ) . notEmpty ( ) . isInt ( ) ] ,
420+ [ check ( 'id' ) . notEmpty ( ) . isUUID ( ) ] ,
421421 async ( req : Request , res : Response ) => {
422422 const errors = validationResult ( req ) ;
423423
@@ -442,7 +442,7 @@ photoRouter.get(
442442// Place associations
443443photoRouter . get (
444444 '/:id/ytplace' ,
445- [ check ( 'id' ) . notEmpty ( ) . isInt ( ) ] ,
445+ [ check ( 'id' ) . notEmpty ( ) . isUUID ( ) ] ,
446446 async ( req : Request , res : Response ) => {
447447 const errors = validationResult ( req ) ;
448448
@@ -479,7 +479,7 @@ photoRouter.get(
479479// Boat associations
480480photoRouter . get (
481481 '/:id/boat' ,
482- [ check ( 'id' ) . notEmpty ( ) . isInt ( ) ] ,
482+ [ check ( 'id' ) . notEmpty ( ) . isUUID ( ) ] ,
483483 async ( req : Request , res : Response ) => {
484484 const errors = validationResult ( req ) ;
485485
@@ -503,7 +503,7 @@ photoRouter.get(
503503// Aircrash associations
504504photoRouter . get (
505505 '/:id/aircrash' ,
506- [ check ( 'id' ) . notEmpty ( ) . isInt ( ) ] ,
506+ [ check ( 'id' ) . notEmpty ( ) . isUUID ( ) ] ,
507507 async ( req : Request , res : Response ) => {
508508 const errors = validationResult ( req ) ;
509509
@@ -520,7 +520,7 @@ photoRouter.get(
520520// People associations
521521photoRouter . get (
522522 '/:id/people' ,
523- [ check ( 'id' ) . notEmpty ( ) . isInt ( ) ] ,
523+ [ check ( 'id' ) . notEmpty ( ) . isUUID ( ) ] ,
524524 async ( req : Request , res : Response ) => {
525525 const errors = validationResult ( req ) ;
526526
@@ -537,7 +537,7 @@ photoRouter.get(
537537// Burial associations
538538photoRouter . get (
539539 '/:id/burial' ,
540- [ check ( 'id' ) . notEmpty ( ) . isInt ( ) ] ,
540+ [ check ( 'id' ) . notEmpty ( ) . isUUID ( ) ] ,
541541 async ( req : Request , res : Response ) => {
542542 const errors = validationResult ( req ) ;
543543
@@ -554,7 +554,7 @@ photoRouter.get(
554554// Interpretive Sites associations
555555photoRouter . get (
556556 '/:id/interpretive-sites' ,
557- [ check ( 'id' ) . notEmpty ( ) . isInt ( ) ] ,
557+ [ check ( 'id' ) . notEmpty ( ) . isUUID ( ) ] ,
558558 async ( req : Request , res : Response ) => {
559559 const errors = validationResult ( req ) ;
560560
@@ -571,7 +571,7 @@ photoRouter.get(
571571// Delete the site id (placeId) from the photo
572572photoRouter . delete (
573573 '/:id/place/:placeId' ,
574- [ check ( 'id' ) . notEmpty ( ) . isInt ( ) ] ,
574+ [ check ( 'id' ) . notEmpty ( ) . isUUID ( ) ] ,
575575 [ check ( 'placeId' ) . notEmpty ( ) . isInt ( ) ] ,
576576 async ( req : Request , res : Response ) => {
577577 const errors = validationResult ( req ) ;
@@ -597,7 +597,7 @@ photoRouter.delete(
597597// Delete ytplace association
598598photoRouter . delete (
599599 '/:id/ytplace/:ytplaceId' ,
600- [ check ( 'id' ) . notEmpty ( ) . isInt ( ) ] ,
600+ [ check ( 'id' ) . notEmpty ( ) . isUUID ( ) ] ,
601601 [ check ( 'ytplaceId' ) . notEmpty ( ) . isInt ( ) ] ,
602602 async ( req : Request , res : Response ) => {
603603 const errors = validationResult ( req ) ;
@@ -623,7 +623,7 @@ photoRouter.delete(
623623// Delete boat association
624624photoRouter . delete (
625625 '/:id/boat/:boatId' ,
626- [ check ( 'id' ) . notEmpty ( ) . isInt ( ) ] ,
626+ [ check ( 'id' ) . notEmpty ( ) . isUUID ( ) ] ,
627627 [ check ( 'boatId' ) . notEmpty ( ) . isInt ( ) ] ,
628628 async ( req : Request , res : Response ) => {
629629 const errors = validationResult ( req ) ;
@@ -649,7 +649,7 @@ photoRouter.delete(
649649// Delete aircrash association
650650photoRouter . delete (
651651 '/:id/aircrash/:yacsinumber' ,
652- [ check ( 'id' ) . notEmpty ( ) . isInt ( ) ] ,
652+ [ check ( 'id' ) . notEmpty ( ) . isUUID ( ) ] ,
653653 [ check ( 'yacsinumber' ) . notEmpty ( ) . isInt ( ) ] ,
654654 async ( req : Request , res : Response ) => {
655655 const errors = validationResult ( req ) ;
@@ -675,7 +675,7 @@ photoRouter.delete(
675675// Delete people association
676676photoRouter . delete (
677677 '/:id/people/:personId' ,
678- [ check ( 'id' ) . notEmpty ( ) . isInt ( ) ] ,
678+ [ check ( 'id' ) . notEmpty ( ) . isUUID ( ) ] ,
679679 [ check ( 'personId' ) . notEmpty ( ) . isInt ( ) ] ,
680680 async ( req : Request , res : Response ) => {
681681 const errors = validationResult ( req ) ;
@@ -701,7 +701,7 @@ photoRouter.delete(
701701// Delete burial association
702702photoRouter . delete (
703703 '/:id/burial/:burialId' ,
704- [ check ( 'id' ) . notEmpty ( ) . isInt ( ) ] ,
704+ [ check ( 'id' ) . notEmpty ( ) . isUUID ( ) ] ,
705705 [ check ( 'burialId' ) . notEmpty ( ) . isInt ( ) ] ,
706706 async ( req : Request , res : Response ) => {
707707 const errors = validationResult ( req ) ;
@@ -727,7 +727,7 @@ photoRouter.delete(
727727// Delete interpretive site association
728728photoRouter . delete (
729729 '/:id/interpretive-sites/:siteId' ,
730- [ check ( 'id' ) . notEmpty ( ) . isInt ( ) ] ,
730+ [ check ( 'id' ) . notEmpty ( ) . isUUID ( ) ] ,
731731 [ check ( 'siteId' ) . notEmpty ( ) . isInt ( ) ] ,
732732 async ( req : Request , res : Response ) => {
733733 const errors = validationResult ( req ) ;
0 commit comments