From c316b0448a576dc09a43e50ddb67d4870ad78db7 Mon Sep 17 00:00:00 2001 From: codemagician Date: Mon, 31 Aug 2026 12:35:15 +0100 Subject: [PATCH] fix: repair broken syntax from #344-#347 merge that blocked the entire build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fea2b78 ("Add user ban, activity, batch enroll, and learning path endpoints (#344, #345, #346, #347)") left the codebase in a non-compiling state — `npm run build` currently fails on `main`: - src/modules/courses/course.routes.ts: the /enroll/batch route registration was missing its closing `);`, so the next app.get(...) call became part of its argument list — unparseable. - src/modules/users/user.routes.ts: same mistake on the /me/learning-path route — missing `);` before the next app.get(...). - src/modules/admin/admin-users.service.ts: an extra `}` closed AdminUsersService right after listUsers(), so banUser() and getUserActivity() ended up declared as free-floating methods outside any class body. `npm run build` (tsc) and `npm run typecheck` (tsc --noEmit -p tsconfig.test.json, src/ portion) both pass clean after this. The remaining tsconfig.test.json errors are pre-existing loosely-typed test mocks scattered across several unrelated test files (stellar, sep10-auth, retry-queue, idempotency, tracing, concurrent-safety) — untouched by fea2b78, not build-blocking, and out of scope here. --- src/modules/admin/admin-users.service.ts | 1 - src/modules/courses/course.routes.ts | 2 ++ src/modules/users/user.routes.ts | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/modules/admin/admin-users.service.ts b/src/modules/admin/admin-users.service.ts index 7ea35ec..80a4b20 100644 --- a/src/modules/admin/admin-users.service.ts +++ b/src/modules/admin/admin-users.service.ts @@ -57,7 +57,6 @@ export class AdminUsersService { total: totalResult?.value ?? 0, }; } -} /** * Ban a user and invalidate all their sessions (#347). Once banned, diff --git a/src/modules/courses/course.routes.ts b/src/modules/courses/course.routes.ts index 2bab8fc..56e8272 100644 --- a/src/modules/courses/course.routes.ts +++ b/src/modules/courses/course.routes.ts @@ -188,6 +188,8 @@ export async function courseRoutes(app: FastifyInstance): Promise { } as FastifySchema, }, (request, reply) => courseController.batchEnroll(request, reply) + ); + app.get<{ Params: { id: string }; Querystring: import("./course.types.js").ListReviewsQuery }>( "/:id/reviews", { diff --git a/src/modules/users/user.routes.ts b/src/modules/users/user.routes.ts index 4a72ea5..0974537 100644 --- a/src/modules/users/user.routes.ts +++ b/src/modules/users/user.routes.ts @@ -104,6 +104,8 @@ export async function userRoutes(app: FastifyInstance): Promise { } as FastifySchema, }, (request, reply) => userController.getLearningPath(request, reply) + ); + app.get<{ Querystring: import("../notifications/notification.types.js").ListNotificationsQuery }>( "/me/notifications", {