Skip to content

Missing destructuring declaration in adminRoutes.js causes server crash #20

Description

@teja-311

Bug Description

The backend server crashes on startup with a syntax error.

Error

SyntaxError: Unexpected token '}'
at routers/adminRoutes.js:21

Root Cause

In backend/routers/adminRoutes.js, the import for getActivityLogsController is missing its opening const { declaration:

// Current (broken):
const {
  getAdminPaymentsController,
} = require("../controllers/paymentRecordsController");
  getActivityLogsController,
} = require("../controllers/activityLogController");

getActivityLogsController is left dangling without a matching const {, causing a syntax error that crashes the whole server on startup.

Proposed Fix

const {
  getAdminPaymentsController,
} = require("../controllers/paymentRecordsController");

const {
  getActivityLogsController,
} = require("../controllers/activityLogController");

This fixes the syntax error and lets the server start cleanly. Happy to open a PR for this if assigned.

Metadata

Metadata

Assignees

Labels

ECSoC26Required label for a PR to be eligible for Sentinel scoringbugSomething broken or not working as describedredoReviewed — needs changes before it can be merged

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions