Skip to content

Commit da26730

Browse files
committed
cleanup
1 parent 8cc2ef1 commit da26730

5 files changed

Lines changed: 8 additions & 50 deletions

File tree

backend/index.js

Lines changed: 0 additions & 17 deletions
This file was deleted.

backend/jest.config.ts

Lines changed: 0 additions & 23 deletions
This file was deleted.

backend/src/controllers/seats.controller.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff 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
}

backend/src/services/seats.service.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff 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 [];

github.ts

Whitespace-only changes.

0 commit comments

Comments
 (0)