mirror of
https://github.com/bluewave-labs/Checkmate.git
synced 2026-05-18 23:48:43 -05:00
@@ -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 });
|
||||
}
|
||||
|
||||
@@ -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<MigrationStats> =>
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user