diff --git a/server/src/controllers/statusPageController.ts b/server/src/controllers/statusPageController.ts index 866dd715a..18428d424 100644 --- a/server/src/controllers/statusPageController.ts +++ b/server/src/controllers/statusPageController.ts @@ -50,7 +50,7 @@ class StatusPageController { await createStatusPageBodyValidation.validateAsync(req.body); await imageValidation.validateAsync(req.file); const teamId = requireTeamId(req?.user?.teamId); - const statusPageId = req.params.id; + const statusPageId = req.params.id as string; if (!statusPageId) { throw new AppError({ message: "Status page ID is required", status: 400 }); } @@ -77,7 +77,7 @@ class StatusPageController { throw new AppError({ message: "Status page URL is required", status: 400 }); } - const statusPage = await this.statusPageService.getStatusPageByUrl(req.params.url); + const statusPage = await this.statusPageService.getStatusPageByUrl(req.params.url as string); const settings = await this.settingsService.getDBSettings(); const showURL = settings.showURL; @@ -116,7 +116,7 @@ class StatusPageController { deleteStatusPage = async (req: Request, res: Response, next: NextFunction) => { try { - const statusPageId = req.params.id; + const statusPageId = req.params.id as string; if (!statusPageId) { throw new AppError({ message: "Status page ID is required", status: 400 }); } diff --git a/server/src/db/migration/0002_convertChecksToTimeSeries.ts b/server/src/db/migration/0002_convertChecksToTimeSeries.ts index 222d210b0..01ed82def 100644 --- a/server/src/db/migration/0002_convertChecksToTimeSeries.ts +++ b/server/src/db/migration/0002_convertChecksToTimeSeries.ts @@ -1,5 +1,4 @@ import mongoose from "mongoose"; -import { BulkWriteResult } from "mongodb"; const CHECKS_COLLECTION = "checks"; const BACKUP_COLLECTION = "checks_backup"; @@ -144,14 +143,14 @@ const migrateBackupData = async (backedUp: boolean): Promise => operations.push({ insertOne: { document: { ...rest, metadata } } }); if (operations.length >= BATCH_SIZE) { - const result: BulkWriteResult = await target.bulkWrite(operations, { ordered: false }); + const result = await target.bulkWrite(operations, { ordered: false }); stats.totalMigrated += result.insertedCount; operations.length = 0; } } if (operations.length) { - const result: BulkWriteResult = await target.bulkWrite(operations, { ordered: false }); + const result = await target.bulkWrite(operations, { ordered: false }); stats.totalMigrated += result.insertedCount; }