@@ -43,7 +43,9 @@ router.get('/diagnose', async (_req, res) => {
4343 try {
4444 id =
4545 ( item as any ) . id || ( ( item as any ) . get && ( item as any ) . get ( 'id' ) ) ;
46- } catch { }
46+ } catch ( e ) {
47+ // Ignore error when getting item ID
48+ }
4749 try {
4850 const populated = await ( item as any ) . populate ( ) ;
4951 if ( id ) goodIds . push ( id ) ;
@@ -125,7 +127,7 @@ router.get('/repeating', validateUser('User'), (req, res) => {
125127 query : { rider } ,
126128 } = req ;
127129 const now = moment ( ) . format ( 'YYYY-MM-DD' ) ;
128- let condition = new Condition ( 'recurring' )
130+ const condition = new Condition ( 'recurring' )
129131 . eq ( true )
130132 . where ( 'endDate' )
131133 . ge ( now )
@@ -274,7 +276,9 @@ router.get('/diagnose', async (_req, res) => {
274276 try {
275277 id =
276278 ( item as any ) . id || ( ( item as any ) . get && ( item as any ) . get ( 'id' ) ) ;
277- } catch { }
279+ } catch ( e ) {
280+ // Ignore error when getting item ID
281+ }
278282 try {
279283 const populated = await ( item as any ) . populate ( ) ;
280284 if ( id ) goodIds . push ( id ) ;
@@ -417,7 +421,10 @@ router.put('/:id', validateUser('User'), (req, res) => {
417421 } else if ( body . $REMOVE && body . $REMOVE . includes ( 'driver' ) ) {
418422 // If driver is being removed, mark as unscheduled
419423 body . schedulingState = SchedulingState . UNSCHEDULED ;
420- } else if ( body . hasOwnProperty ( 'driver' ) && ! body . driver ) {
424+ } else if (
425+ Object . prototype . hasOwnProperty . call ( body , 'driver' ) &&
426+ ! body . driver
427+ ) {
421428 // If driver is explicitly set to null/undefined, mark as unscheduled
422429 body . schedulingState = SchedulingState . UNSCHEDULED ;
423430 }
0 commit comments