@@ -25,6 +25,7 @@ router.get(
2525 officeMove = "false" ,
2626 orderBy = "resent" ,
2727 isQuoted = "false" ,
28+ isPastRequest = "false" ,
2829 } = req . query ;
2930 const parseLimit = parseInt ( limit as string ) ;
3031 const parseCursor = parseInt ( cursor as string ) ;
@@ -33,6 +34,7 @@ router.get(
3334 const parseHouseMove = checkBoolean ( houseMove as string ) ;
3435 const parseOfficeMove = checkBoolean ( officeMove as string ) ;
3536 const parseIsQuoted = checkBoolean ( isQuoted as string ) ;
37+ const parsePastRequest = checkBoolean ( isPastRequest as string ) ;
3638
3739 const movingRequestList =
3840 await movingRequestService . getMovingRequestListByMover ( moverId , {
@@ -45,6 +47,7 @@ router.get(
4547 officeMove : parseOfficeMove || false ,
4648 orderBy : orderBy as string ,
4749 isQuoted : parseIsQuoted || false ,
50+ isPastRequest : parsePastRequest || false ,
4851 } ) ;
4952 return res . status ( 200 ) . send ( movingRequestList ) ;
5053 } catch ( error ) {
@@ -122,15 +125,18 @@ router.post(
122125 asyncHandle ( async ( req , res , next ) => {
123126 try {
124127 const { customerId } = req . user as { customerId : number } ;
125- const { service, movingDate, pickupAddress, dropOffAddress } = req . body ;
128+ const { service, movingDate, pickupAddress, dropOffAddress, region } =
129+ req . body ;
126130 const date = new Date ( movingDate ) ;
131+ const parseRegion = parseInt ( region as string ) ;
127132 const movingRequest = await movingRequestService . createMovingRequest (
128133 customerId ,
129134 {
130135 service,
131136 movingDate : date ,
132137 pickupAddress,
133138 dropOffAddress,
139+ region : parseRegion ,
134140 }
135141 ) ;
136142 return res . status ( 201 ) . send ( movingRequest ) ;
0 commit comments