File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -18,18 +18,16 @@ class SeatsController {
1818 const { since, until, org } = req . query as { [ key : string ] : string | undefined } ;
1919
2020 try {
21- // Create params object with all query parameters
22- const params = { since, until, org } ;
23-
21+ const sanitizedOrg = typeof org === 'string' ? org : undefined ;
22+ const params = { since, until, org : sanitizedOrg } ;
23+
2424 // Use our new unified getSeat method that handles both ID and login
2525 // Pass the ID directly without conversion - the service will handle it
2626 const seat = await SeatsService . getSeat ( id , params ) ;
2727
2828 res . status ( 200 ) . json ( seat ) ;
2929 } catch ( error : unknown ) {
3030 const errorMessage = error instanceof Error ? error . message : 'Unknown error occurred' ;
31- const sanitizedId = encodeURIComponent ( id ) ;
32- console . error ( `Error in getSeat controller for id=${ sanitizedId } :` , errorMessage ) ;
3331 res . status ( 500 ) . json ( { error : errorMessage } ) ;
3432 }
3533 }
Original file line number Diff line number Diff line change @@ -191,7 +191,7 @@ class SeatsService {
191191 const query : mongoose . FilterQuery < SeatType > = { assignee_id : numericId } ;
192192
193193 if ( params . org ) {
194- query . org = params . org ;
194+ query . org = { $eq : params . org } ;
195195 }
196196
197197 if ( params . since || params . until ) {
@@ -219,11 +219,11 @@ class SeatsService {
219219
220220 return results || [ ] ;
221221 } catch ( error : unknown ) {
222- console . error ( '========== SEAT LOOKUP ERROR ==========' ) ;
223- console . error ( ` Error retrieving seat data for ${ identifier } :` , error ) ;
222+ logger . error ( '========== SEAT LOOKUP ERROR ==========' ) ;
223+ logger . error ( ' Error retrieving seat data for %s:' , identifier , error ) ;
224224 // Safe access to stack property
225- console . error ( `Stack trace:` , error instanceof Error ? error . stack : 'No stack trace available' ) ;
226- console . error ( '=======================================' ) ;
225+ logger . error ( `Stack trace:` , error instanceof Error ? error . stack : 'No stack trace available' ) ;
226+ logger . error ( '=======================================' ) ;
227227
228228 // Return empty results rather than throwing error
229229 return [ ] ;
You can’t perform that action at this time.
0 commit comments